Re: [PATCH] device core: fix dma_mask handling in platform_device_register_full

From: Linus Torvalds
Date: Wed Mar 11 2020 - 13:26:10 EST


On Wed, Mar 11, 2020 at 10:18 AM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> 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