public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] qed: Add support for memory registeration verbs
@ 2016-11-14 12:43 Dan Carpenter
  2016-11-15 12:12 ` Amrani, Ram
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-11-14 12:43 UTC (permalink / raw)
  To: kernel-janitors

Hello Ram Amrani,

The patch ee8eaea30b13: "qed: Add support for memory registeration
verbs" from Oct 1, 2016, leads to the following static checker
warning:

	drivers/net/ethernet/qlogic/qed/qed_roce.c:2354 qed_rdma_register_tid()
	error: uninitialized symbol 'fw_return_code'.

drivers/net/ethernet/qlogic/qed/qed_roce.c
  2343          /* DIF */
  2344          if (params->dif_enabled) {
  2345                  SET_FIELD(p_ramrod->flags2,
  2346                            RDMA_REGISTER_TID_RAMROD_DATA_DIF_ON_HOST_FLG, 1);
  2347                  DMA_REGPAIR_LE(p_ramrod->dif_error_addr,
  2348                                 params->dif_error_addr);
  2349                  DMA_REGPAIR_LE(p_ramrod->dif_runt_addr, params->dif_runt_addr);
  2350          }
  2351  
  2352          rc = qed_spq_post(p_hwfn, p_ent, &fw_return_code);
  2353  
  2354          if (fw_return_code != RDMA_RETURN_OK) {

This basically works even when rc is a negative error code and
fw_return_code is uninitialized but hella nasty.

  2355                  DP_NOTICE(p_hwfn, "fw_return_code = %d\n", fw_return_code);
  2356                  return -EINVAL;
  2357          }
  2358  
  2359          DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Register TID, rc = %d\n", rc);
  2360          return rc;
  2361  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [bug report] qed: Add support for memory registeration verbs
  2016-11-14 12:43 [bug report] qed: Add support for memory registeration verbs Dan Carpenter
@ 2016-11-15 12:12 ` Amrani, Ram
  0 siblings, 0 replies; 2+ messages in thread
From: Amrani, Ram @ 2016-11-15 12:12 UTC (permalink / raw)
  To: kernel-janitors

> The patch ee8eaea30b13: "qed: Add support for memory registeration verbs"
> from Oct 1, 2016, leads to the following static checker
> warning:
> 
> 	drivers/net/ethernet/qlogic/qed/qed_roce.c:2354
> qed_rdma_register_tid()
> 	error: uninitialized symbol 'fw_return_code'.
> 
> drivers/net/ethernet/qlogic/qed/qed_roce.c
>   2343          /* DIF */
>   2344          if (params->dif_enabled) {
>   2345                  SET_FIELD(p_ramrod->flags2,
>   2346
> RDMA_REGISTER_TID_RAMROD_DATA_DIF_ON_HOST_FLG, 1);
>   2347                  DMA_REGPAIR_LE(p_ramrod->dif_error_addr,
>   2348                                 params->dif_error_addr);
>   2349                  DMA_REGPAIR_LE(p_ramrod->dif_runt_addr, params-
> >dif_runt_addr);
>   2350          }
>   2351
>   2352          rc = qed_spq_post(p_hwfn, p_ent, &fw_return_code);
>   2353
>   2354          if (fw_return_code != RDMA_RETURN_OK) {
> 
> This basically works even when rc is a negative error code and fw_return_code is
> uninitialized but hella nasty.
> 
>   2355                  DP_NOTICE(p_hwfn, "fw_return_code = %d\n",
> fw_return_code);
>   2356                  return -EINVAL;
>   2357          }
>   2358
>   2359          DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Register TID, rc = %d\n",
> rc);
>   2360          return rc;
>   2361  }
> 
> regards,
> dan carpenter

Hi Dan,
While there's no bug in there the code is hard to understand and I will submit a change
in the near future.
Thanks,
Ram


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-15 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-14 12:43 [bug report] qed: Add support for memory registeration verbs Dan Carpenter
2016-11-15 12:12 ` Amrani, Ram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox