Commit 8290b567 authored by Harshit Mogalapalli's avatar Harshit Mogalapalli Committed by Greg Kroah-Hartman

usb: typec: tipd: Fix dereferencing freeing memory in tps6598x_apply_patch()

release_firmware() already frees fw, fix this my moving release_firmware
after the dereference.

Fixes: 916b8e5f ("usb: typec: tipd: add error log to provide firmware name and size")
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: default avatarJavier Carrasco <javier.carrasco@wolfvision.net>
Link: https://lore.kernel.org/r/20240724162356.992763-1-harshit.m.mogalapalli@oracle.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5a444bea
......@@ -1191,11 +1191,11 @@ static int tps6598x_apply_patch(struct tps6598x *tps)
dev_info(tps->dev, "Firmware update succeeded\n");
release_fw:
release_firmware(fw);
if (ret) {
dev_err(tps->dev, "Failed to write patch %s of %zu bytes\n",
firmware_name, fw->size);
}
release_firmware(fw);
return ret;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment