[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260108110351.27771-1-chaitanyamishra.ai@gmail.com>
Date: Thu, 8 Jan 2026 16:33:51 +0530
From: Chaitanya Mishra <chaitanyamishra.ai@...il.com>
To: gregkh@...uxfoundation.org
Cc: rmfrfs@...il.com,
johan@...nel.org,
elder@...nel.org,
greybus-dev@...ts.linaro.org,
linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org,
chaitanyamishra.ai@...il.com
Subject: Re: [PATCH v2] staging: greybus: lights: avoid NULL deref
Hi Greg,
Found by manual code review while walking the error paths in
Gb_lights_light_config(): channels_count is set before channels
allocation, but cleanup uses channels_count to iterate and dereference
light->channels. If kcalloc() fails, that becomes a NULL deref.
Fix is simply deferring channels_count publication until after the
allocation succeeds; v2 includes the requested comment.
Tested with:
./scripts/checkpatch.pl --strict -g HEAD
./scripts/checkpatch.pl outgoing/0001-staging-greybus-lights-avoid-NULL-deref.patch
I couldn't build-test locally on macOS due to missing <elf.h> for
kernel host tools.
Thanks,
Chaitanya
Powered by blists - more mailing lists