linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: zhengyongjun <zhengyongjun3@huawei.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "mchehab@kernel.org" <mchehab@kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Subject: 答复: [PATCH -next] media: atomisp: Remove unneeded if-null-free check
Date: Wed, 2 Jun 2021 01:32:38 +0000	[thread overview]
Message-ID: <9087d9398abf469f9f1ff30fcb608719@huawei.com> (raw)
In-Reply-To: <20210601144644.GB1955@kadam>

Thanks for your advice, I send patch v2 now :)

-----邮件原件-----
发件人: Dan Carpenter [mailto:dan.carpenter@oracle.com] 
发送时间: 2021年6月1日 22:47
收件人: zhengyongjun <zhengyongjun3@huawei.com>
抄送: mchehab@kernel.org; linux-media@vger.kernel.org; linux-staging@lists.linux.dev; linux-kernel@vger.kernel.org; sakari.ailus@linux.intel.com; gregkh@linuxfoundation.org
主题: Re: [PATCH -next] media: atomisp: Remove unneeded if-null-free check

On Tue, Jun 01, 2021 at 10:20:05PM +0800, Zheng Yongjun wrote:
> Eliminate the following coccicheck warning:
> 
> drivers/staging/media/atomisp/pci/sh_css_firmware.c:369:4-10: WARNING:
> NULL check before some freeing functions is not needed.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
>  drivers/staging/media/atomisp/pci/sh_css_firmware.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/sh_css_firmware.c b/drivers/staging/media/atomisp/pci/sh_css_firmware.c
> index f4ce8ace9d50..980fc09fcc8b 100644
> --- a/drivers/staging/media/atomisp/pci/sh_css_firmware.c
> +++ b/drivers/staging/media/atomisp/pci/sh_css_firmware.c
> @@ -365,8 +365,7 @@ void sh_css_unload_firmware(void)
>  		for (i = 0; i < sh_css_num_binaries; i++) {
>  			if (fw_minibuffer[i].name)
>  				kfree((void *)fw_minibuffer[i].name);

Change this too.

> -			if (fw_minibuffer[i].buffer)
> -				kvfree(fw_minibuffer[i].buffer);
> +			kvfree(fw_minibuffer[i].buffer);
>  		}
>  		kfree(fw_minibuffer);
>  		fw_minibuffer = NULL;

regards,
dan carpenter

      reply	other threads:[~2021-06-02  1:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 14:20 [PATCH -next] media: atomisp: Remove unneeded if-null-free check Zheng Yongjun
2021-06-01 14:46 ` Dan Carpenter
2021-06-02  1:32   ` zhengyongjun [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=9087d9398abf469f9f1ff30fcb608719@huawei.com \
    --to=zhengyongjun3@huawei.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.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).