Re: [PATCH] scsi: elx: efct: fix memory leak in efct_hw_parse_filter()
From: Daniel Wagner
Date: Fri Jun 13 2025 - 03:42:57 EST
On Thu, Jun 12, 2025 at 09:35:18PM +0500, Vitaliy Shevtsov wrote:
> strsep() modifies the address of the pointer passed to it so that it no
> longer points to the original address. This means kfree() gets the wrong
> pointer.
>
> Fix this by passing unmodified pointer returned from kstrdup() to kfree().
>
> Found by Linux Verification Center (linuxtesting.org) with Svace.
>
> Fixes: 4df84e846624 ("scsi: elx: efct: Driver initialization routines")
> Signed-off-by: Vitaliy Shevtsov <v.shevtsov@xxxxxxxxxxxxxxxxx>
Reviewed-by: Daniel Wagner <dwagner@xxxxxxx>