[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191029125606.GH1922@kadam>
Date: Tue, 29 Oct 2019 15:57:09 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
Dan Carpenter <dan.carpenter@...cle.co>,
linux-sparse@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: detecting misuse of of_get_property
On Tue, Oct 29, 2019 at 12:43:24PM +0100, Rasmus Villemoes wrote:
> On 29/10/2019 11.50, Dan Carpenter wrote:
> > This should probably work?
>
> I haven't tested it, but yes, something like that. Can you also do the
> case of struct property::value, i.e. handling
>
> struct property *p = ...;
> u32 *v = p->value;
Attached.
This has a bunch of flaws like "void *value = p->value;" doesn't
generate a warning. A function that returns a u32 pointer doing
"return p->value;" doesn't generate a value.
Anyway, it's a starting point to experiment with.
regards,
dan carpenter
View attachment "check_of_get_property.c" of type "text/x-csrc" (2077 bytes)
Powered by blists - more mailing lists