misc: cxl: Fix possible null pointer dereference
PATCH RESEND v2 1/1 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 <[email protected]>
--- drivers/misc/cxl/guest.c | 2 -- 1 file changed, 2 deletions(-)
drivers/misc/cxl/guest.c +0 -2
@@ -1018,8 +1018,6 @@ int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_nvoid cxl_guest_remove_afu (struct cxl_afu *afu) { -pr_devel ("in %s - AFU(%d)\n" , __func__, afu->slice); -if (!afu)return ;
Signature · 1 line
1.7.12.4
Le 04/10/2018 à 07:02, zhong jiang a écrit :
Quoted 5 lines
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 <[email protected]>---
Acked-by Frederic Barrat <[email protected]>
Quoted 16 lines
drivers/misc/cxl/guest.c | 2 -- 1 file changed, 2 deletions(-)drivers/misc/cxl/guest.c +0
-2@@ -1018,8 +1018,6 @@ int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_nvoid cxl_guest_remove_afu (struct cxl_afu *afu) { -pr_devel ("in %s - AFU(%d)\n" , __func__, afu->slice); -if (!afu)return ;
Quoted 4 lines · zhong jiang
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 <[email protected]>
Acked-by Andrew Donnellan <[email protected]>
Quoted 18 lines
--- drivers/misc/cxl/guest.c | 2 -- 1 file changed, 2 deletions(-)drivers/misc/cxl/guest.c +0
-2@@ -1018,8 +1018,6 @@ int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_nvoid cxl_guest_remove_afu (struct cxl_afu *afu) { -pr_devel ("in %s - AFU(%d)\n" , __func__, afu->slice); -if (!afu)return ;
Signature · 2 lines
Andrew Donnellan OzLabs, ADL Canberra [email protected] IBM Australia Limited