[PATCH 3.16 108/305] qlcnic: fix a return in qlcnic_dcb_get_capability()

From: Ben Hutchings
Date: Sun Feb 03 2019 - 09:29:13 EST

3.16.63-rc1 review patch. If anyone has any objections, please let me know.


From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

commit c94f026fb742b2d3199422751dbc4f6fc0e753d8 upstream.

These functions are supposed to return one on failure and zero on
success. Returning a zero here could cause uninitialized variable
bugs in several of the callers. For example:

drivers/scsi/cxgbi/cxgb4i/cxgb4i.c:1660 get_iscsi_dcb_priority()
error: uninitialized symbol 'caps'.

Fixes: 48365e485275 ("qlcnic: dcb: Add support for CEE Netlink interface.")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
@@ -883,7 +883,7 @@ static u8 qlcnic_dcb_get_capability(stru
struct qlcnic_adapter *adapter = netdev_priv(netdev);

if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state))
- return 0;
+ return 1;

switch (capid) {