Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1684608

Re: [PATCH] iio: multiplexer: add NULL check on devm_kzalloc() and devm_kmemdup() return values

From "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Newsgroups linux.kernel
Subject Re: [PATCH] iio: multiplexer: add NULL check on devm_kzalloc() and devm_kmemdup() return values
Date 2017-07-10 21:50 +0200
Message-ID <u1MQV-L2-11@gated-at.bofh.it> (permalink)
References <u0twZ-7l9-3@gated-at.bofh.it> <u1o2d-265-3@gated-at.bofh.it> <u1o2d-265-5@gated-at.bofh.it> <u1o2d-265-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Jonathan,

Quoting Jonathan Cameron <jic23@kernel.org>:

> On Fri, 7 Jul 2017 11:26:35 +0200
> Peter Rosin <peda@axentia.se> wrote:
>
>> On 2017-07-07 06:57, Peter Rosin wrote:
>> > On 2017-07-07 06:53, Gustavo A. R. Silva wrote:
>> >> Check return values from call to devm_kzalloc() and devm_kmemup()
>> >
>> > If someone cares enough: s/devm_kmemup/evm_kmemdup/
>>
>> Strange, there seems to be some inherent shortage of 'd' characters...
>>
>> Cheers,
>> pea :-)
>>
>> >
>> >> in order to prevent a NULL pointer dereference.
>> >>
>> >> This issue was detected using Coccinelle and the following  
>> semantic patch:
>> >>
>> >> @@
>> >> expression x;
>> >> identifier fld;
>> >> @@
>> >>
>> >> * x = devm_kzalloc(...);
>> >>    ... when != x == NULL
>> >>    x->fld
>> >>
>> >> Cc: Peter Rosin <peda@axentia.se>
>> >> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>> >
>> > Either way,
>> >
>> > Reviewed-by: Peter Rosin <peda@axentia.se>
>> >
>> > Thanks!
>> >
> The relevant patch adding the file in questions hasn't yet worked it's
> way back to the iio tree so I can't apply this until it does.
>
> That is likely to be a few weeks away yet.  Please give me a poke if
> I seem to have forgotten it!
>

OK, I will do that. :)

Thanks!
--
Gustavo A. R. Silva

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] iio: multiplexer: add NULL check on devm_kzalloc() and  devm_kmemdup() return values "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-07-07 07:00 +0200
  Re: [PATCH] iio: multiplexer: add NULL check on devm_kzalloc() and  devm_kmemdup() return values Jonathan Cameron <jic23@kernel.org> - 2017-07-09 19:20 +0200
    Re: [PATCH] iio: multiplexer: add NULL check on devm_kzalloc() and  devm_kmemdup() return values "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-07-10 21:50 +0200

csiph-web