Skip to content

Commit

Permalink
qlcnic: dcb: default to returning -EOPNOTSUPP
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Tom Rix authored and davem330 committed Mar 26, 2022
1 parent 08be6b1 commit 1521db3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static inline int qlcnic_dcb_get_hw_capability(struct qlcnic_dcb *dcb)
if (dcb && dcb->ops->get_hw_capability)
return dcb->ops->get_hw_capability(dcb);

return 0;
return -EOPNOTSUPP;
}

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

return 0;
return -EOPNOTSUPP;
}

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

return 0;
return -EOPNOTSUPP;
}

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

return 0;
return -EOPNOTSUPP;
}

static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb)
{
if (dcb && dcb->ops->get_cee_cfg)
return dcb->ops->get_cee_cfg(dcb);

return 0;
return -EOPNOTSUPP;
}

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

0 comments on commit 1521db3

Please sign in to comment.