* [RESEND PATCHv2] misc: cxl: Fix possible null pointer dereference
@ 2018-10-04 5:02 zhong jiang
2018-10-04 11:48 ` Frederic Barrat
2018-10-04 11:59 ` Andrew Donnellan
0 siblings, 2 replies; 3+ messages in thread
From: zhong jiang @ 2018-10-04 5:02 UTC (permalink / raw)
To: gregkh; +Cc: andrew.donnellan, fbarrat, linux-kernel
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>
---
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 3bc0c15..5d28d9e 100644
--- a/drivers/misc/cxl/guest.c
+++ b/drivers/misc/cxl/guest.c
@@ -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;
--
1.7.12.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RESEND PATCHv2] misc: cxl: Fix possible null pointer dereference
2018-10-04 5:02 [RESEND PATCHv2] misc: cxl: Fix possible null pointer dereference zhong jiang
@ 2018-10-04 11:48 ` Frederic Barrat
2018-10-04 11:59 ` Andrew Donnellan
1 sibling, 0 replies; 3+ messages in thread
From: Frederic Barrat @ 2018-10-04 11:48 UTC (permalink / raw)
To: zhong jiang, gregkh; +Cc: andrew.donnellan, fbarrat, linux-kernel
Le 04/10/2018 à 07:02, zhong jiang a écrit :
> 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: Frederic Barrat <fbarrat@linux.ibm.com>
> 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 3bc0c15..5d28d9e 100644
> --- a/drivers/misc/cxl/guest.c
> +++ b/drivers/misc/cxl/guest.c
> @@ -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;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RESEND PATCHv2] misc: cxl: Fix possible null pointer dereference
2018-10-04 5:02 [RESEND PATCHv2] misc: cxl: Fix possible null pointer dereference zhong jiang
2018-10-04 11:48 ` Frederic Barrat
@ 2018-10-04 11:59 ` Andrew Donnellan
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Donnellan @ 2018-10-04 11:59 UTC (permalink / raw)
To: zhong jiang, gregkh; +Cc: fbarrat, linux-kernel
On 4/10/18 3:02 pm, zhong jiang wrote:
> 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>
> ---
> 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 3bc0c15..5d28d9e 100644
> --- a/drivers/misc/cxl/guest.c
> +++ b/drivers/misc/cxl/guest.c
> @@ -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;
>
>
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-04 11:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 5:02 [RESEND PATCHv2] misc: cxl: Fix possible null pointer dereference zhong jiang
2018-10-04 11:48 ` Frederic Barrat
2018-10-04 11:59 ` Andrew Donnellan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.