Re: [PATCH] kernel/resource: Invalid memory access in __release_resource

From: Ricardo Ribalda Delgado
Date: Mon Apr 20 2015 - 16:49:57 EST


Hello

On Mon, Apr 20, 2015 at 10:36 PM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote:

>> > From reading drivers/base/platform.c, it looks like the intent is
>> > that platform device users would use these interfaces:
>>
>> I can take a look to modify OF to use insert_resource(), but I still
>> think that no matter what, we should add this extra check, like the
>> propossed patch or maybe with a BUG_ON()....
>
> I think it would be nicer to make OF use platform_device_add_resources()
> and platform_device_add() because then there's less duplication of code.
> But Grant might have had a reason for avoiding that.
>
> Bjorn

I think I am going to make two patches, one modifying OF as you
suggest, and another one
adding a BUG_ON to release_resource. Then you can decide to apply one
or two with the feedback from Grant

I have no hardware to test it right now, but tomorrow morning I can
test the patches and send them.


Thanks!
--
Ricardo Ribalda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/