Skip to content

Commit 1521db3

Browse files
Tom Rixdavem330
authored andcommitted
qlcnic: dcb: default to returning -EOPNOTSUPP
Clang static analysis reports this issue qlcnic_dcb.c:382:10: warning: Assigned value is garbage or undefined mbx_out = *val; ^ ~~~~ val is set in the qlcnic_dcb_query_hw_capability() wrapper. If there is no query_hw_capability op in dcp, success is returned without setting the val. For this and similar wrappers, return -EOPNOTSUPP. Fixes: 14d385b ("qlcnic: dcb: Query adapter DCB capabilities.") Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 08be6b1 commit 1521db3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static inline int qlcnic_dcb_get_hw_capability(struct qlcnic_dcb *dcb)
5151
if (dcb && dcb->ops->get_hw_capability)
5252
return dcb->ops->get_hw_capability(dcb);
5353

54-
return 0;
54+
return -EOPNOTSUPP;
5555
}
5656

5757
static inline void qlcnic_dcb_free(struct qlcnic_dcb *dcb)
@@ -65,7 +65,7 @@ static inline int qlcnic_dcb_attach(struct qlcnic_dcb *dcb)
6565
if (dcb && dcb->ops->attach)
6666
return dcb->ops->attach(dcb);
6767

68-
return 0;
68+
return -EOPNOTSUPP;
6969
}
7070

7171
static inline int
@@ -74,7 +74,7 @@ qlcnic_dcb_query_hw_capability(struct qlcnic_dcb *dcb, char *buf)
7474
if (dcb && dcb->ops->query_hw_capability)
7575
return dcb->ops->query_hw_capability(dcb, buf);
7676

77-
return 0;
77+
return -EOPNOTSUPP;
7878
}
7979

8080
static inline void qlcnic_dcb_get_info(struct qlcnic_dcb *dcb)
@@ -89,15 +89,15 @@ qlcnic_dcb_query_cee_param(struct qlcnic_dcb *dcb, char *buf, u8 type)
8989
if (dcb && dcb->ops->query_cee_param)
9090
return dcb->ops->query_cee_param(dcb, buf, type);
9191

92-
return 0;
92+
return -EOPNOTSUPP;
9393
}
9494

9595
static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb)
9696
{
9797
if (dcb && dcb->ops->get_cee_cfg)
9898
return dcb->ops->get_cee_cfg(dcb);
9999

100-
return 0;
100+
return -EOPNOTSUPP;
101101
}
102102

103103
static inline void qlcnic_dcb_aen_handler(struct qlcnic_dcb *dcb, void *msg)

0 commit comments

Comments
 (0)