Re: [PATCH 1/6] can: esd_usb: Fix possible calls to kfree() with NULL
From: Stefan Mätje <stefan.maetje@esd.eu>
Date: 2025-08-15 14:57:48
Also in:
linux-can
From: Stefan Mätje <stefan.maetje@esd.eu>
Date: 2025-08-15 14:57:48
Also in:
linux-can
Am Dienstag, dem 12.08.2025 um 13:33 +0100 schrieb Vadim Fedorenko:
On 11/08/2025 22:06, Stefan Mätje wrote:quoted
In esd_usb_start() kfree() is called with the msg variable even if the allocation of *msg failed.But kfree() works fine with NULL pointers, have you seen any real issues with this code?
Hello Vadim, I've not seen real problems with this code. And when I posted the patch I knew that kfree() can cope with NULL pointers. But in any case calling a *free() function with a NULL pointer sends shivers over my spine and I want to avoid to stumble over this again and again. Best regards, Stefan