Skip to content

Commit c7071f4

Browse files
Colin Ian Kingdlezcano
authored andcommitted
thermal: qcom: tsens-v1: Fix kfree of a non-pointer value
Currently the kfree of pointer qfprom_cdata is kfreeing an error value that has been cast to a pointer rather than a valid address. Fix this by removing the kfree. Fixes: 95ededc ("thermal: qcom: tsens-v1: Add support for MSM8956 and MSM8976") Signed-off-by: Colin Ian King <[email protected]> Tested-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 11ff4bd commit c7071f4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/thermal/qcom/tsens-v1.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,8 @@ static int calibrate_8976(struct tsens_priv *priv)
240240
u32 *qfprom_cdata;
241241

242242
qfprom_cdata = (u32 *)qfprom_read(priv->dev, "calib");
243-
if (IS_ERR(qfprom_cdata)) {
244-
kfree(qfprom_cdata);
243+
if (IS_ERR(qfprom_cdata))
245244
return PTR_ERR(qfprom_cdata);
246-
}
247245

248246
mode = (qfprom_cdata[4] & MSM8976_CAL_SEL_MASK);
249247
dev_dbg(priv->dev, "calibration mode is %d\n", mode);

0 commit comments

Comments
 (0)