Re: [PATCH] s390/vfio-ap: Fix module unload memory leak of matrix_dev

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

 



On Fri, Jun 18, 2021 at 09:35:24AM -0400, Jason J. Herne wrote:
> vfio_ap_matrix_dev_release is shadowing the global matrix_dev with driver
> data that never gets set. So when release is called we end up not freeing
> matrix_dev. The fix is to remove the shadow variable and just free the
> global.

I would clarify this commit message to say that the drv_data of the
matrix_dev is never set and so dev_get_drvdata() always returns NULL

And I would suggest to use 

  container_of(dev, struct ap_matrix_dev, dev)

instead of the global variable, and probably NULL the global
too..

Jason




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux