Re: [PATCH v2] s390/netiucv: handle memory allocation failure in conn_action_start()
From: Markus Elfring
Date: Tue Jun 25 2024 - 03:24:41 EST
> … Thus add a corresponding return value
I suggest to move this sentence into a subsequent text line.
> … This prevent null pointer dereferenced kernel panic when memory
> exhausted situation with the netiucv driver operating as an FSM state
> in "conn_action_start".
Do you find an improved wording still relevant for a separate paragraph?
> Fixes: eebce3856737 ("[S390]: Adapt netiucv driver to new IUCV API")
> Cc: linux-s390@xxxxxxxxxxxxxxx
Would you like to specify a “stable tag”?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v6.10-rc5#n34
> ---
I would appreciate a version description behind the marker line.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc5#n713
…
> +++ b/drivers/s390/net/netiucv.c
> @@ -855,6 +855,9 @@ static void conn_action_start(fsm_instance *fi, int event, void *arg)
>
> fsm_newstate(fi, CONN_STATE_SETUPWAIT);
> conn->path = iucv_path_alloc(NETIUCV_QUEUELEN_DEFAULT, 0, GFP_KERNEL);
> + if (!conn->path)
> + return;
…
Would the following statement variant become more appropriate here?
+ return -ENOMEM;
Regards,
Markus