Re: [PATCH] vme: remove unneeded kfree

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

 



On Thu, Sep 6, 2018 at 1:51 AM Ding Xiang
<dingxiang@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> put_device will call vme_dev_release to free vdev, kfree is
> unnecessary here.

That does seem to be the case.  I think "unnecessary" is overly kind,
it does seem to be a double free.

Looks like the issue was introduced back in 2013 by commit
def1820d25fa ("vme: add missing put_device() after device_register()
fails").

It seems you should *either* kfree() the vdev, _or_ do put_device(),
but doing both seems wrong.

I presume the device_register() has never failed, and this being
vme-only I'm guessing there isn't a vibrant testing community.

Greg?

              Linus
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux