kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink()
@ 2020-12-09  6:52 Dan Carpenter
  2020-12-09  7:28 ` Chaitanya Kulkarni
  2020-12-09  7:36 ` Jinpu Wang
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2020-12-09  6:52 UTC (permalink / raw)
  To: Danil Kipnis, Md Haris Iqbal
  Cc: Jack Wang, Jens Axboe, Lutz Pogrell, linux-block, kernel-janitors

The "ret" variable should be set to -ENOMEM but it returns uninitialized
stack data.

Fixes: 64e8a6ece1a5 ("block/rnbd-clt: Dynamically alloc buffer for pathname & blk_symlink_name")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/block/rnbd/rnbd-clt-sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c
index c3c96a567568..a5cd47b82b40 100644
--- a/drivers/block/rnbd/rnbd-clt-sysfs.c
+++ b/drivers/block/rnbd/rnbd-clt-sysfs.c
@@ -499,6 +499,7 @@ static int rnbd_clt_add_dev_symlink(struct rnbd_clt_dev *dev)
 	dev->blk_symlink_name = kzalloc(len, GFP_KERNEL);
 	if (!dev->blk_symlink_name) {
 		rnbd_clt_err(dev, "Failed to allocate memory for blk_symlink_name\n");
+		ret = -ENOMEM;
 		goto out_err;
 	}
 
-- 
2.29.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink()
  2020-12-09  6:52 [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink() Dan Carpenter
@ 2020-12-09  7:28 ` Chaitanya Kulkarni
  2020-12-09  7:36 ` Jinpu Wang
  1 sibling, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2020-12-09  7:28 UTC (permalink / raw)
  To: Dan Carpenter, Danil Kipnis, Md Haris Iqbal
  Cc: Jack Wang, Jens Axboe, Lutz Pogrell, linux-block, kernel-janitors

On 12/8/20 10:54 PM, Dan Carpenter wrote:
> The "ret" variable should be set to -ENOMEM but it returns uninitialized
> stack data.
>
> Fixes: 64e8a6ece1a5 ("block/rnbd-clt: Dynamically alloc buffer for pathname & blk_symlink_name")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink()
  2020-12-09  6:52 [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink() Dan Carpenter
  2020-12-09  7:28 ` Chaitanya Kulkarni
@ 2020-12-09  7:36 ` Jinpu Wang
  2020-12-09  8:03   ` Dan Carpenter
  1 sibling, 1 reply; 5+ messages in thread
From: Jinpu Wang @ 2020-12-09  7:36 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Danil Kipnis, Md Haris Iqbal, Jens Axboe, Lutz Pogrell,
	linux-block, kernel-janitors

Hi Dan,



On Wed, Dec 9, 2020 at 7:52 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> The "ret" variable should be set to -ENOMEM but it returns uninitialized
> stack data.
>
> Fixes: 64e8a6ece1a5 ("block/rnbd-clt: Dynamically alloc buffer for pathname & blk_symlink_name")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks for the patch. But there is already a fix from Colin merged in
block tree:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?h=for-5.11/drivers&ids3c15bd3a944b8eeaacdddf061759b6a83dd3f4

There is still other problem through with commit 64e8a6ece1a5
("block/rnbd-clt: Dynamically alloc buffer for pathname &
blk_symlink_name")

I will send the fix today together with other changes.

Regards!
Jack

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink()
  2020-12-09  7:36 ` Jinpu Wang
@ 2020-12-09  8:03   ` Dan Carpenter
  2020-12-09  8:05     ` Jinpu Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2020-12-09  8:03 UTC (permalink / raw)
  To: Jinpu Wang
  Cc: Danil Kipnis, Md Haris Iqbal, Jens Axboe, Lutz Pogrell,
	linux-block, kernel-janitors

On Wed, Dec 09, 2020 at 08:36:31AM +0100, Jinpu Wang wrote:
> Hi Dan,
> 
> 
> 
> On Wed, Dec 9, 2020 at 7:52 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > The "ret" variable should be set to -ENOMEM but it returns uninitialized
> > stack data.
> >
> > Fixes: 64e8a6ece1a5 ("block/rnbd-clt: Dynamically alloc buffer for pathname & blk_symlink_name")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Thanks for the patch. But there is already a fix from Colin merged in
> block tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?h=for-5.11/drivers&ids3c15bd3a944b8eeaacdddf061759b6a83dd3f4
> 
> There is still other problem through with commit 64e8a6ece1a5
> ("block/rnbd-clt: Dynamically alloc buffer for pathname &
> blk_symlink_name")
> 
> I will send the fix today together with other changes.

Ah...  Haha...  Sorry about that.  We already discussed this yesterday.

What happens is that when I write a patch, I normally save it in my
postponed messages until the next day.  But then I decided to not fix it
but instead to just report it.  Unfortunately, I forgot to delete it and
I also forgot about yesterday's discussion because I have the memory of
a gnat.  :P

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink()
  2020-12-09  8:03   ` Dan Carpenter
@ 2020-12-09  8:05     ` Jinpu Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Jinpu Wang @ 2020-12-09  8:05 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Danil Kipnis, Md Haris Iqbal, Jens Axboe, Lutz Pogrell,
	linux-block, kernel-janitors

On Wed, Dec 9, 2020 at 9:03 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> On Wed, Dec 09, 2020 at 08:36:31AM +0100, Jinpu Wang wrote:
> > Hi Dan,
> >
> >
> >
> > On Wed, Dec 9, 2020 at 7:52 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > >
> > > The "ret" variable should be set to -ENOMEM but it returns uninitialized
> > > stack data.
> > >
> > > Fixes: 64e8a6ece1a5 ("block/rnbd-clt: Dynamically alloc buffer for pathname & blk_symlink_name")
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > Thanks for the patch. But there is already a fix from Colin merged in
> > block tree:
> > https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?h=for-5.11/drivers&ids3c15bd3a944b8eeaacdddf061759b6a83dd3f4
> >
> > There is still other problem through with commit 64e8a6ece1a5
> > ("block/rnbd-clt: Dynamically alloc buffer for pathname &
> > blk_symlink_name")
> >
> > I will send the fix today together with other changes.
>
> Ah...  Haha...  Sorry about that.  We already discussed this yesterday.
>
> What happens is that when I write a patch, I normally save it in my
> postponed messages until the next day.  But then I decided to not fix it
> but instead to just report it.  Unfortunately, I forgot to delete it and
> I also forgot about yesterday's discussion because I have the memory of
> a gnat.  :P
>
> regards,
> dan carpenter
>
No problem, thanks! :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-09  8:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09  6:52 [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink() Dan Carpenter
2020-12-09  7:28 ` Chaitanya Kulkarni
2020-12-09  7:36 ` Jinpu Wang
2020-12-09  8:03   ` Dan Carpenter
2020-12-09  8:05     ` Jinpu Wang

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).