Skip to content
Commit b54709d0 authored by Kent Gibson's avatar Kent Gibson Committed by Rajeshkumar Ramasamy
Browse files

gpiolib: cdev: fix null pointer dereference in linereq_free()

commit e6391dd38aaa576d5d1db52a30a7f7f7292a3111 from
https://nv-tegra.nvidia.com/r/3rdparty/canonical/linux-jammy.git

 jetson_36.3

Fix a kernel NULL pointer dereference reported by gpio kselftests.

linereq_free() can be called as part of the cleanup of a failed request,
at which time the desc for a line may not have been determined, so it
is unsafe to dereference without a check.

Add a check prior to dereferencing the line desc.

Bug 3961133

Change-Id: I30bf608c3ee816547a3641968e721cd2155a5960
Fixes: 2068339a ("gpiolib: cdev: Add hardware timestamp clock type")
Signed-off-by: default avatarKent Gibson <warthog618@gmail.com>
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
Reviewed-on: https://git-master.nvidia.com/r/c/3rdparty/canonical/linux-jammy/+/3088861


GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: default avatarGautham Srinivasan <gauthams@nvidia.com>
Reviewed-by: default avatarGautham Srinivasan <gauthams@nvidia.com>
Reviewed-by: default avatarsvcacv <svcacv@nvidia.com>
Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarRajeshkumar Ramasamy <rajeshkumar.ramasamy@windriver.com>
parent 234cf14e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment