Re: [PATCH] nbd: don't leak nbd_config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 23, 2017 at 04:27:56PM +0200, Ilya Dryomov wrote:
> On Tue, May 23, 2017 at 4:16 PM, Jens Axboe <axboe@xxxxxx> wrote:
> > On 05/23/2017 08:14 AM, Josef Bacik wrote:
> >> On Tue, May 23, 2017 at 12:38:31PM +0200, Ilya Dryomov wrote:
> >>> nbd_config is allocated in nbd_alloc_config(), but never freed.
> >>>
> >>> Fixes: 5ea8d10802ec ("nbd: separate out the config information")
> >>> Signed-off-by: Ilya Dryomov <idryomov@xxxxxxxxx>
> >>> ---
> >>>  drivers/block/nbd.c | 1 +
> >>>  1 file changed, 1 insertion(+)
> >>>
> >>
> >> Oops, thanks Ilya
> >>
> >> Reviewed-by: Josef Bacik <jbacik@xxxxxx>
> >
> > Since config is referenced, why isn't this done in nbd_config_put()
> > instead?
> 
> Josef's 5ea8d10802ec added that nbd->config = NULL to nbd_reset(), so
> I followed his lead.  It could be done nbd_config_put() -- nbd_reset()
> call in nbd_dev_add() looks like a no-op to me.  Josef?
> 

Yeah it used to be called more, but when I moved the config to be ref counted it
lost it's old uses and I just didn't notice enough to delete it.  Just fold that
into nbd_config_put() and call it a day.  Thanks,

Josef



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux