misc: cxl: Fix possible null pointer dereference

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>
This commit is contained in:
zhong jiang 2018-10-04 13:02:53 +08:00 committed by Greg Kroah-Hartman
parent e862faa968
commit 3dac3583bf
1 changed files with 0 additions and 2 deletions

View File

@ -1018,8 +1018,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;