Re: [PATCH] s390/netiucv: handle memory allocation failure in conn_action_start()

From: Markus Elfring
Date: Sun Jun 23 2024 - 10:27:58 EST


> This patch handle potential null pointer dereference in
> iucv_path_connect(), When iucv_path_alloc() fails to allocate memory
> for 'rc'.

1. Can a wording approach (like the following) be a better change description?

A null pointer is stored in the data structure member “path” after a call
of the function “iucv_path_alloc” failed. This pointer was passed to
a subsequent call of the function “iucv_path_connect” where an undesirable
dereference will be performed then.
Thus add a corresponding return value check.


2. May the proposed error message be omitted
(because a memory allocation failure might have been reported
by an other function call already)?


3. Is there a need to adjust the return type of the function “conn_action_start”?


4. Would you like to add any tags (like “Fixes”) accordingly?


5. Under which circumstances will development interests grow for increasing
the application of scope-based resource management?
https://elixir.bootlin.com/linux/v6.10-rc4/source/include/linux/cleanup.h#L8


Regards,
Markus