Re: [PATCH rdma-next V1 03/17] IB/core: Release allocated memory in cache setup failure

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

 



On Thu, Dec 15, 2016 at 10:42:19PM -0500, ira.weiny wrote:
> >  err:
> >  	gid_table_cleanup_one(device);
> > +free:
> > +	kfree(device->cache.pkey_cache);
> > +	kfree(device->cache.lmc_cache);
> 
> Despite the fact that another thread said this is supposed to be ok because
> ib_cache_release_one free's these I much prefer what you have done here.
> 
> However, don't you need to NULL these out so that ib_cache_release_one can
> safely call kfree again?

Yes.

I feel deja vue here, like I've pointed this out before and the
resolution was to just rely on the release function so we don't have
bugs like this.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux