summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/vp27smpx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/i2c/vp27smpx.c')
-rw-r--r--drivers/media/i2c/vp27smpx.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/i2c/vp27smpx.c b/drivers/media/i2c/vp27smpx.c
index e71f139..208a095 100644
--- a/drivers/media/i2c/vp27smpx.c
+++ b/drivers/media/i2c/vp27smpx.c
@@ -169,7 +169,7 @@ static int vp27smpx_probe(struct i2c_client *client,
v4l_info(client, "chip found @ 0x%x (%s)\n",
client->addr << 1, client->adapter->name);
- state = kzalloc(sizeof(struct vp27smpx_state), GFP_KERNEL);
+ state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
if (state == NULL)
return -ENOMEM;
sd = &state->sd;
@@ -186,7 +186,6 @@ static int vp27smpx_remove(struct i2c_client *client)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
v4l2_device_unregister_subdev(sd);
- kfree(to_state(sd));
return 0;
}