misc: cxl: Fix possible null pointer dereference
authorzhong jiang <zhongjiang@huawei.com>
Thu, 4 Oct 2018 05:02:53 +0000 (13:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2019 08:53:52 +0000 (09:53 +0100)
[ 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@huawei.com>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/cxl/guest.c

index 3e102cd6ed914d992152128423cce8cbab33e830..d08509cd978a45a73436935675aaca3dfc46777e 100644 (file)
@@ -1026,8 +1026,6 @@ err1:
 
 void cxl_guest_remove_afu(struct cxl_afu *afu)
 {
-       pr_devel("in %s - AFU(%d)\n", __func__, afu->slice);
-
        if (!afu)
                return;