Re: [PATCH] cxl: Fix null pointer dereference in cxl_get_fd

2023-12-05 Thread Kunwu Chan
Hi Fred, Thanks for your reply. But there is a question, whether we should return an error code in error path so that the caller of the 'cxl_get_fd' can know the specific reason. rather than just return NULL. Such as: - int rc, flags, fdtmp; + int rc = 0, flags, fdtmp;

Re: [PATCH] cxl: Fix null pointer dereference in cxl_get_fd

2023-12-04 Thread Frederic Barrat
On 04/12/2023 03:07, Kunwu Chan wrote: kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: bdecf76e319a ("cxl: Fix coredump generation when cxl_get_fd() is used") Signed-off-by: Kunwu Chan --- drivers/misc/cxl/api.c | 4 1 file

[PATCH] cxl: Fix null pointer dereference in cxl_get_fd

2023-12-03 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: bdecf76e319a ("cxl: Fix coredump generation when cxl_get_fd() is used") Signed-off-by: Kunwu Chan --- drivers/misc/cxl/api.c | 4 1 file changed, 4 insertions(+) diff --git