Re: [PATCH] drivers/net/wan/hdlc_ppp: fix potential null pointer in ppp_cp_event logging

From: Simon Horman
Date: Fri Oct 03 2025 - 04:33:27 EST


On Thu, Oct 02, 2025 at 06:05:41PM +0000, Kriish Sharma wrote:
> Fixes warnings observed during compilation with -Wformat-overflow:
>
> drivers/net/wan/hdlc_ppp.c: In function ‘ppp_cp_event’:
> drivers/net/wan/hdlc_ppp.c:353:17: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
> 353 | netdev_info(dev, "%s down\n", proto_name(pid));
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/wan/hdlc_ppp.c:342:17: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
> 342 | netdev_info(dev, "%s up\n", proto_name(pid));
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Introduce local variable `pname` and fallback to "unknown" if proto_name(pid)
> returns NULL.
>
> Fixes: 262858079afd ("Add linux-next specific files for 20250926")
> Signed-off-by: Kriish Sharma <kriish.sharma2006@xxxxxxxxx>

Hi Kriish,

As it looks like there will be another revision of this patch,
I have a few minor points on process for your consideration.

As a fix for Networking code present in the net tree this should probably
be targeted at the net tree. That means it should apply cleanly to that
tree (I assume it does). And the target tree should be denoted in the
subject. Like this:

Subject: [PATCh net] ...

This is as opposed to non-fix patches which, generally, are targeted
at the net-nex tree.

Specifying the target tree helps land patches in the right place
for CI. And helps the maintainers too.

Also, git history isn't consistent here, but I would suggest
that a more succinct prefix is appropriate for this patch.
Perhaps 'hdlc_ppp:'

I.e.: Subject: [PATCH net] hdlc_ppp: ...

For more in process for networking patches please see:
https://docs.kernel.org/process/maintainer-netdev.html

Thanks!

...