staging: pi433: fix potential null dereference
authorMichael Straube <straube.linux@gmail.com>
Sun, 25 Nov 2018 09:22:25 +0000 (10:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:47:02 +0000 (19:47 +0100)
commit4acd5adecf20bf9af4ae85de10150c13eb3aca65
tree55c3254bc189a1c9d36216ffcfd32545946043f9
parent6eaf5b9e6e7c1dcf2a6d6e149d4cc7afdc3d4d8c
staging: pi433: fix potential null dereference

[ Upstream commit 64c4c4ca6c129a4191e8e1e91b2d5d9b8d08c518 ]

Add a test for successful call to cdev_alloc() to avoid
potential null dereference. Issue reported by smatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Fixes: 874bcba65f9a ("staging: pi433: New driver")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/pi433/pi433_if.c