[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aQJPoOocbpj_-iq5@horms.kernel.org>
Date: Wed, 29 Oct 2025 17:32:16 +0000
From: Simon Horman <horms@...nel.org>
To: Zhang Chujun <zhangchujun@...s.chinamobile.com>
Cc: przemyslaw.kitszel@...el.com, devlink@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH] devlink: add NULL check in devlink_dpipe_entry_clear
On Wed, Oct 29, 2025 at 03:02:56PM +0800, Zhang Chujun wrote:
> This patch adds a NULL check for the pointer 'entry' at the entry
> point of the function devlink_pipe_entry_clear. If the passed
> 'entry' is NULL, the function returns immediately, avoiding subsequent
> dereferencing of a NULL pointer and thus preventing potential kernel
> crahses or segmentation faults.
>
> Signed-off-by: Zhang Chujun <zhangchujun@...s.chinamobile.com>
Hi,
Do you have a case where entry can be NULL?
If not, this feels like defensive programming,
which, AFAIK, is not the preferred approach for Kernel code.
...
Powered by blists - more mailing lists