Skip to contentSkip to conversation

dpll: zl3073x: Fix double free in zl3073x_devlink_flash_update()

PATCH Superseded Dan Carpenter 3 participants 4 messages Sep 23, 2025 – Sep 25, 2025

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dpll: zl3073x: Fix double free in zl3073x_devlink_flash_update()

The zl3073x_devlink_flash_prepare() function calls zl3073x_fw_free() and the caller also calls zl3073x_devlink_flash_update() so it leads to a double free. Delete the extra free.

Fixes a1e891fe4ae8 ("dpll: zl3073x: Implement devlink flash callback")
---
 drivers/dpll/zl3073x/devlink.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dpll/zl3073x/devlink.c +0 -1
index f55d5309d4f9..ccc22332b346 100644
@@ -167,7 +167,6 @@ zl3073x_devlink_flash_prepare(struct zl3073x_dev *zldev,
 		zl3073x_devlink_flash_notify(zldev,
 					     "Utility is missing in firmware",
 					     NULL, 0, 0);
-		zl3073x_fw_free(zlfw);
 		return -ENOEXEC;
 	}
 
Signature · 1 line
2.51.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Dan Carpenter

The zl3073x_devlink_flash_prepare() function calls zl3073x_fw_free() and the caller also calls zl3073x_devlink_flash_update() so it leads

s/zl3073x_devlink_flash_update/zl3073x_fw_free/ ?

Quoted 4 lines

to a double free. Delete the extra free.

Fixes a1e891fe4ae8 ("dpll: zl3073x: Implement devlink flash callback")

Thanks Dan,

Aside from the nit above, this looks good to me.

...

#2 lore raw
Quoted 6 lines · Simon Horman
Quoted 2 lines · Dan Carpenter

The zl3073x_devlink_flash_prepare() function calls zl3073x_fw_free() and the caller also calls zl3073x_devlink_flash_update() so it leads

s/zl3073x_devlink_flash_update/zl3073x_fw_free/ ?

Sigh. Let me resend.

regards,
dan carpenter

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Dan Carpenter
Quoted 15 lines · Dan Carpenter

The zl3073x_devlink_flash_prepare() function calls zl3073x_fw_free() and the caller also calls zl3073x_devlink_flash_update() so it leads to a double free. Delete the extra free.

Fixes a1e891fe4ae8 ("dpll: zl3073x: Implement devlink flash callback")
---
  drivers/dpll/zl3073x/devlink.c | 1 -
  1 file changed, 1 deletion(-)
drivers/dpll/zl3073x/devlink.c +0 -0
index f55d5309d4f9..ccc22332b346 100644

drivers/dpll/zl3073x/devlink.c zl3073x_devlink_flash_prepare(struct zl3073x_dev *zldev, · line 171

Quoted 6 lines
drivers/dpll/zl3073x/devlink.c +0 -1
@@ -167,7 +167,6 @@ zl3073x_devlink_flash_prepare(struct zl3073x_dev *zldev,
  		zl3073x_devlink_flash_notify(zldev,
  					     "Utility is missing in firmware",
  					     NULL, 0, 0);
-		zl3073x_fw_free(zlfw);
  		return -ENOEXEC;
  	}

Thanks, Dan!