From: Keith Busch <kbusch@kernel.org>
To: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: linux-nvme@lists.infradead.org, Chaitanya Kulkarni <kch@nvidia.com>
Subject: Re: [PATCH] fabrics: fix return value of hostnqn_read_file()
Date: Tue, 7 Sep 2021 14:29:20 -0700 [thread overview]
Message-ID: <20210907212920.GC591280@dhcp-10-100-145-180.wdc.com> (raw)
In-Reply-To: <20210906005719.296481-1-chaitanyak@nvidia.com>
On Sun, Sep 05, 2021 at 05:57:19PM -0700, Chaitanya Kulkarni wrote:
> @@ -855,7 +855,7 @@ static char *hostnqn_read_file(void)
>
> out:
> fclose(f);
> - return ret;
> + return strcmp(ret, "") == 0 ? NULL : ret;
> }
But if the 'goto out' label is used, you are calling strcmp() with a
NULL pointer.
And if "ret" is an emptry string, I think you still need to free() it
here since it is not being returned anymore.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-09-07 21:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-06 0:57 [PATCH] fabrics: fix return value of hostnqn_read_file() Chaitanya Kulkarni
2021-09-07 21:29 ` Keith Busch [this message]
2021-09-08 0:05 ` Chaitanya Kulkarni
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=20210907212920.GC591280@dhcp-10-100-145-180.wdc.com \
--to=kbusch@kernel.org \
--cc=chaitanyak@nvidia.com \
--cc=kch@nvidia.com \
--cc=linux-nvme@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.