* Re: [PATCH] device core: fix dma_mask handling in platform_device_register_full
[not found] ` <20200311161551.GA24878@lst.de>
@ 2020-03-11 17:18 ` Greg KH
2020-03-11 17:23 ` Christoph Hellwig
2020-03-11 17:25 ` Linus Torvalds
0 siblings, 2 replies; 3+ messages in thread
From: Greg KH @ 2020-03-11 17:18 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: aros, torvalds, linux-kernel, iommu
On Wed, Mar 11, 2020 at 05:15:51PM +0100, Christoph Hellwig wrote:
> On Wed, Mar 11, 2020 at 05:14:23PM +0100, Greg KH wrote:
> > On Wed, Mar 11, 2020 at 05:07:10PM +0100, Christoph Hellwig wrote:
> > > Ever since the generic platform device code started allocating DMA masks
> > > itself the code to allocate and leak a private DMA mask in
> > > platform_device_register_full has been superflous. More so the fact that
> > > it unconditionally frees the DMA mask allocation in the failure path
> > > can lead to slab corruption if the function fails later on for a device
> > > where it didn't allocate the mask. Just remove the offending code.
> > >
> > > Fixes: cdfee5623290 ("driver core: initialize a default DMA mask for platform device")
> > > Reported-by: Artem S. Tashkinov <aros@gmx.com>
> > > Tested-by: Artem S. Tashkinov <aros@gmx.com>
> >
> > No s-o-b from you? :(
> >
> > I can take this, or Linus, you can take this now if you want to as well:
>
> Sorry, here it is:
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Is this still needed with the patch that Linus just committed to his
tree?
thanks,
greg k-h
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] device core: fix dma_mask handling in platform_device_register_full
2020-03-11 17:18 ` [PATCH] device core: fix dma_mask handling in platform_device_register_full Greg KH
@ 2020-03-11 17:23 ` Christoph Hellwig
2020-03-11 17:25 ` Linus Torvalds
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2020-03-11 17:23 UTC (permalink / raw)
To: Greg KH; +Cc: aros, torvalds, Christoph Hellwig, iommu, linux-kernel
On Wed, Mar 11, 2020 at 06:18:02PM +0100, Greg KH wrote:
> > Sorry, here it is:
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Is this still needed with the patch that Linus just committed to his
> tree?
No.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] device core: fix dma_mask handling in platform_device_register_full
2020-03-11 17:18 ` [PATCH] device core: fix dma_mask handling in platform_device_register_full Greg KH
2020-03-11 17:23 ` Christoph Hellwig
@ 2020-03-11 17:25 ` Linus Torvalds
1 sibling, 0 replies; 3+ messages in thread
From: Linus Torvalds @ 2020-03-11 17:25 UTC (permalink / raw)
To: Greg KH
Cc: Artem S. Tashkinov, Christoph Hellwig, iommu, Linux Kernel Mailing List
On Wed, Mar 11, 2020 at 10:18 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> Is this still needed with the patch that Linus just committed to his
> tree?
My patch is basically the same, just with the field renamed too, and
not blindly just assigning to "*pdev->dev.dma_mask" (my variant does
pdev->platform_dma_mask = pdevinfo->dma_mask;
pdev->dev.dma_mask = &pdev->platform_dma_mask;
instead of that incomprehensible
*pdev->dev.dma_mask = pdevinfo->dma_mask;
which depends on that dev.dma_mask pointer having been initialized in
a random place earlier).
I had the cleanups (uncommited) in my tree, and just removed the
kfree() as per Christoph.
Linus
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-11 17:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20200311160710.376090-1-hch@lst.de>
[not found] ` <20200311161423.GA3941932@kroah.com>
[not found] ` <20200311161551.GA24878@lst.de>
2020-03-11 17:18 ` [PATCH] device core: fix dma_mask handling in platform_device_register_full Greg KH
2020-03-11 17:23 ` Christoph Hellwig
2020-03-11 17:25 ` Linus Torvalds
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).