On 12/01/2024 06:49, Kunwu Chan wrote:
kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.
Uniformly handle resource release in error paths. And when an
error occurs, an error pointer should be returned.
Fixes: bdecf76e319a ("cxl: Fix coredump genera
On Fri, 2024-01-12 at 13:49 +0800, Kunwu Chan wrote:
> +err:
> + if (rc < 0)
> + return ERR_PTR(rc);
> return NULL;
I don't think there's a way for this NULL to ever get returned?
Apart from that it looks good:
Reviewed-by: Andrew Donnellan
--
Andrew DonnellanOzLabs
kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.
Uniformly handle resource release in error paths. And when an
error occurs, an error pointer should be returned.
Fixes: bdecf76e319a ("cxl: Fix coredump generation when cxl_get_fd() is used")
Signed-off-