Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1727684

Re: [PATCH 8/8] staging: ccree: remove BUG macro usage

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH 8/8] staging: ccree: remove BUG macro usage
Date 2017-09-06 21:30 +0200
Message-ID <umObn-69u-17@gated-at.bofh.it> (permalink)
References <ulyV4-6e7-19@gated-at.bofh.it> <ulyV9-6e7-135@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Sep 03, 2017 at 11:56:50AM +0300, Gilad Ben-Yossef wrote:
> @@ -1154,7 +1150,8 @@ static inline int ssi_buffer_mgr_aead_chain_data(
>  		//if have reached the end of the sgl, then this is unexpected
>  		if (!areq_ctx->src_sgl) {
>  			SSI_LOG_ERR("reached end of sg list. unexpected\n");
> -			BUG();
> +			return -EINVAL;
> +			goto chain_data_exit;

You've got a direct return followed by a goto.

It's a do-nothing goto that just returns rc.  I hate those.  I've tried
to review locking bugs to see if single returns prevent future
programmers from introducing new error paths which don't unlock.  They
don't really help...

regards,
dan carpenter

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] staging: ccree: more cleanup work for 4.14 Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-03 11:00 +0200
  [PATCH 7/8] staging: ccree: replace noop macro with inline Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-03 11:00 +0200
    Re: [PATCH 7/8] staging: ccree: replace noop macro with inline Dan Carpenter <dan.carpenter@oracle.com> - 2017-09-09 11:20 +0200
  [PATCH 1/8] staging: ccree: Replace kzalloc with devm_kzalloc Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-03 11:00 +0200
  [PATCH 3/8] staging: ccree: Use platform_get_irq and devm_request_irq Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-03 11:00 +0200
  [PATCH 2/8] staging: ccree: Convert to devm_ioremap_resource for map, unmap Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-03 11:00 +0200
  [PATCH 8/8] staging: ccree: remove BUG macro usage Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-03 11:00 +0200
    Re: [PATCH 8/8] staging: ccree: remove BUG macro usage Dan Carpenter <dan.carpenter@oracle.com> - 2017-09-06 21:30 +0200
      Re: [PATCH 8/8] staging: ccree: remove BUG macro usage Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-07 11:10 +0200

csiph-web