Skip to contentSkip to conversation

Staging: atomisp: kfreeing a devm allocated pointer

PATCH New Dan Carpenter 1 participant 1 message Mar 14, 2017

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: atomisp: kfreeing a devm allocated pointer

We shouldn't pass devm allocated pointers to kfree() or it leads to a double free.

Fixes a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
drivers/staging/media/atomisp/i2c/imx/otp_brcc064_e2prom.c +0 -1
index 242e934a6030..b11f90c5960c 100644
@@ -69,7 +69,6 @@ void *brcc064_otp_read(struct v4l2_subdev *sd, u8 dev_addr,
 
 		r = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg));
 		if (r != ARRAY_SIZE(msg)) {
-			kfree(buffer);
 			dev_err(&client->dev, "read failed at 0x%03x\n", addr);
 			return NULL;
 		}
drivers/staging/media/atomisp/i2c/imx/otp_e2prom.c +0 -1
index ce4e7ab7781c..73d041f97811 100644
@@ -79,7 +79,6 @@ void *e2prom_otp_read(struct v4l2_subdev *sd, u8 dev_addr,
 
 		r = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg));
 		if (r != ARRAY_SIZE(msg)) {
-			kfree(buffer);
 			dev_err(&client->dev, "read failed at 0x%03x\n", addr);
 			return NULL;
 		}