Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Vishal Verma <vishal.l.verma@intel.com>, <nvdimm@lists.linux.dev>,
	<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH ndctl] cxl/memdev: initialize 'rc' in action_update_fw()
Date: Mon, 31 Jul 2023 13:28:01 -0700	[thread overview]
Message-ID: <cbc1f98f-0f1d-0025-906d-a57b79c1003c@intel.com> (raw)
In-Reply-To: <20230731-coverity-fix-v1-1-9b70ff6aa388@intel.com>



On 7/31/23 13:18, Vishal Verma wrote:
> Static analysis complains that in some cases, an uninitialized 'rc' can
> get returned from action_update_fw(). Since this can only happen in a
> 'no-op' case, initialize rc to 0.
> 
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>   cxl/memdev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cxl/memdev.c b/cxl/memdev.c
> index 1ad871a..f6a2d3f 100644
> --- a/cxl/memdev.c
> +++ b/cxl/memdev.c
> @@ -679,7 +679,7 @@ static int action_update_fw(struct cxl_memdev *memdev,
>   	const char *devname = cxl_memdev_get_devname(memdev);
>   	struct json_object *jmemdev;
>   	unsigned long flags;
> -	int rc;
> +	int rc = 0;
>   
>   	if (param.cancel)
>   		return cxl_memdev_cancel_fw_update(memdev);
> 
> ---
> base-commit: 32cec0c5cfe669940107ce030beeb1e02e5a767b
> change-id: 20230731-coverity-fix-edc28fd6e0fe
> 
> Best regards,

  reply	other threads:[~2023-07-31 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31 20:18 [PATCH ndctl] cxl/memdev: initialize 'rc' in action_update_fw() Vishal Verma
2023-07-31 20:28 ` Dave Jiang [this message]
2023-07-31 20:40 ` Verma, Vishal L

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=cbc1f98f-0f1d-0025-906d-a57b79c1003c@intel.com \
    --to=dave.jiang@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@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