Commit 1521db37 authored by Tom Rix's avatar Tom Rix Committed by David S. Miller

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: 14d385b9 ("qlcnic: dcb: Query adapter DCB capabilities.")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 08be6b13
...@@ -51,7 +51,7 @@ static inline int qlcnic_dcb_get_hw_capability(struct qlcnic_dcb *dcb) ...@@ -51,7 +51,7 @@ static inline int qlcnic_dcb_get_hw_capability(struct qlcnic_dcb *dcb)
if (dcb && dcb->ops->get_hw_capability) if (dcb && dcb->ops->get_hw_capability)
return dcb->ops->get_hw_capability(dcb); return dcb->ops->get_hw_capability(dcb);
return 0; return -EOPNOTSUPP;
} }
static inline void qlcnic_dcb_free(struct qlcnic_dcb *dcb) static inline void qlcnic_dcb_free(struct qlcnic_dcb *dcb)
...@@ -65,7 +65,7 @@ static inline int qlcnic_dcb_attach(struct qlcnic_dcb *dcb) ...@@ -65,7 +65,7 @@ static inline int qlcnic_dcb_attach(struct qlcnic_dcb *dcb)
if (dcb && dcb->ops->attach) if (dcb && dcb->ops->attach)
return dcb->ops->attach(dcb); return dcb->ops->attach(dcb);
return 0; return -EOPNOTSUPP;
} }
static inline int static inline int
...@@ -74,7 +74,7 @@ qlcnic_dcb_query_hw_capability(struct qlcnic_dcb *dcb, char *buf) ...@@ -74,7 +74,7 @@ qlcnic_dcb_query_hw_capability(struct qlcnic_dcb *dcb, char *buf)
if (dcb && dcb->ops->query_hw_capability) if (dcb && dcb->ops->query_hw_capability)
return dcb->ops->query_hw_capability(dcb, buf); return dcb->ops->query_hw_capability(dcb, buf);
return 0; return -EOPNOTSUPP;
} }
static inline void qlcnic_dcb_get_info(struct qlcnic_dcb *dcb) static inline void qlcnic_dcb_get_info(struct qlcnic_dcb *dcb)
...@@ -89,7 +89,7 @@ qlcnic_dcb_query_cee_param(struct qlcnic_dcb *dcb, char *buf, u8 type) ...@@ -89,7 +89,7 @@ qlcnic_dcb_query_cee_param(struct qlcnic_dcb *dcb, char *buf, u8 type)
if (dcb && dcb->ops->query_cee_param) if (dcb && dcb->ops->query_cee_param)
return dcb->ops->query_cee_param(dcb, buf, type); 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) static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb)
...@@ -97,7 +97,7 @@ static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb) ...@@ -97,7 +97,7 @@ static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb)
if (dcb && dcb->ops->get_cee_cfg) if (dcb && dcb->ops->get_cee_cfg)
return dcb->ops->get_cee_cfg(dcb); return dcb->ops->get_cee_cfg(dcb);
return 0; return -EOPNOTSUPP;
} }
static inline void qlcnic_dcb_aen_handler(struct qlcnic_dcb *dcb, void *msg) static inline void qlcnic_dcb_aen_handler(struct qlcnic_dcb *dcb, void *msg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment