From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
Deepak R Varma <drv@mailo.com>,
Ding Xiang <dingxiang@cmss.chinamobile.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Robert Foss <robert.foss@linaro.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Yang Li <abaci-bugfix@linux.alibaba.com>,
Zheng Yongjun <zhengyongjun3@huawei.com>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-staging@lists.linux.dev, llvm@lists.linux.dev
Subject: Re: [PATCH 3/3] media: atomisp: handle errors at sh_css_create_isp_params()
Date: Mon, 15 Nov 2021 12:50:13 +0300 [thread overview]
Message-ID: <20211115095012.GB26989@kadam> (raw)
In-Reply-To: <f1157236eacdaab3def9b7d18f1c2e7ef9a3699d.1636672052.git.mchehab+huawei@kernel.org>
On Thu, Nov 11, 2021 at 11:08:53PM +0000, Mauro Carvalho Chehab wrote:
> The succ var tracks memory allocation erros on this function.
>
> Fix it, in order to stop this W=1 Werror in clang:
>
> drivers/staging/media/atomisp/pci/sh_css_params.c:2430:7: error: variable 'succ' set but not used [-Werror,-Wunused-but-set-variable]
> bool succ = true;
> ^
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>
> To mailbombing on a large number of people, only mailing lists were C/C on the cover.
> See [PATCH 0/3] at: https://lore.kernel.org/all/cover.1636672052.git.mchehab+huawei@kernel.org/
>
> drivers/staging/media/atomisp/pci/sh_css_params.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c
> index dbd3bfe3d343..3cc5b82a8a31 100644
> --- a/drivers/staging/media/atomisp/pci/sh_css_params.c
> +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
> @@ -2473,6 +2473,10 @@ sh_css_create_isp_params(struct ia_css_stream *stream,
> succ &= (ddr_ptrs->macc_tbl != mmgr_NULL);
>
> *isp_params_out = params;
> +
> + if (!succ)
> + return -ENOMEM;
> +
> return err;
Better to "return 0;"
regards,
dan carpenter
prev parent reply other threads:[~2021-11-15 9:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 23:08 [PATCH 0/3] Fix some W=1 clang Werror at staging/media Mauro Carvalho Chehab
2021-11-11 23:08 ` [PATCH 1/3] media: ipu3: drop an unused variable Mauro Carvalho Chehab
2021-11-12 20:43 ` Nathan Chancellor
2021-11-16 12:57 ` Sakari Ailus
2021-11-11 23:08 ` [PATCH 2/3] media: atomisp-gc2235: drop an unused var Mauro Carvalho Chehab
2021-11-12 20:46 ` Nathan Chancellor
2021-11-15 9:28 ` Dan Carpenter
2021-11-15 17:55 ` Nick Desaulniers
2021-11-11 23:08 ` [PATCH 3/3] media: atomisp: handle errors at sh_css_create_isp_params() Mauro Carvalho Chehab
2021-11-12 20:49 ` Nathan Chancellor
2021-11-15 9:50 ` Dan Carpenter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211115095012.GB26989@kadam \
--to=dan.carpenter@oracle.com \
--cc=abaci-bugfix@linux.alibaba.com \
--cc=dingxiang@cmss.chinamobile.com \
--cc=drv@mailo.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linuxarm@huawei.com \
--cc=llvm@lists.linux.dev \
--cc=mauro.chehab@huawei.com \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=robert.foss@linaro.org \
--cc=sakari.ailus@linux.intel.com \
--cc=zhengyongjun3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).