[PATCH AUTOSEL 4.19 196/209] misc: cxl: Fix possible null pointer dereference
From: Sasha Levin
Date: Tue Nov 12 2019 - 21:17:10 EST
From: zhong jiang <zhongjiang@xxxxxxxxxx>
[ Upstream commit 3dac3583bf1a61db6aaf31dfd752c677a4400afd ]
It is not safe to dereference an object before a null test. It is
not needed and just remove them. Ftrace can be used instead.
Signed-off-by: zhong jiang <zhongjiang@xxxxxxxxxx>
Acked-by: Andrew Donnellan <andrew.donnellan@xxxxxxxxxxx>
Acked-by: Frederic Barrat <fbarrat@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/misc/cxl/guest.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c
index b83a373e3a8dd..08f4a512afad2 100644
--- a/drivers/misc/cxl/guest.c
+++ b/drivers/misc/cxl/guest.c
@@ -1020,8 +1020,6 @@ int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_n
void cxl_guest_remove_afu(struct cxl_afu *afu)
{
- pr_devel("in %s - AFU(%d)\n", __func__, afu->slice);
-
if (!afu)
return;
--
2.20.1