misc: cxl: delete possible null pointer dereference
PATCH v2 1/1 misc: cxl: delete possible null pointer dereference
It is safe to dereference an object below a NULL test. For the sake of debugging. Just delete the call of possible null pointer dereference.
--- drivers/misc/cxl/guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/cxl/guest.c +1 -1
@@ -1018,7 +1018,7 @@ 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); +pr_devel ("in %s\n" , __func__);if (!afu)return ;
Signature · 1 line
1.7.12.4
Greg KH
maintainerQuoted 13 lines · zhong jiang
It is safe to dereference an object below a NULL test. For the sake of debugging. Just delete the call of possible null pointer dereference.
Signed-off-by zhong jiang <[email protected]>--- drivers/misc/cxl/guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/cxl/guest.c +0
-0
drivers/misc/cxl/guest.c int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_n · line 1021
Quoted 5 lines
drivers/misc/cxl/guest.c +1
-1@@ -1018,7 +1018,7 @@ 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); +pr_devel ("in %s\n" , __func__);
This call should just be deleted, it's not needed, ftrace can be used instead.
thanks,
greg k-h
Quoted 15 lines · Greg KH
Quoted 14 lines · zhong jiang
It is safe to dereference an object below a NULL test. For the sake of debugging. Just delete the call of possible null pointer dereference.
Signed-off-by zhong jiang <[email protected]>--- drivers/misc/cxl/guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/cxl/guest.c +0
-0@@ -1018,7 +1018,7 @@ int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_n
Quoted 6 lines
drivers/misc/cxl/guest.c int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_n · line 1021
Quoted 4 lines
drivers/misc/cxl/guest.c +1
-1void cxl_guest_remove_afu (struct cxl_afu *afu) { -pr_devel ("in %s - AFU(%d)\n" , __func__, afu->slice); +pr_devel ("in %s\n" , __func__);This call should just be deleted, it's not needed, ftrace can be used instead.
Fine. Will do.
Sincerely,
zhong jiang
Quoted 6 lines
thanks,
greg k-h
.