--- zzzz-none-000/linux-3.10.107/drivers/media/i2c/tw9903.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/media/i2c/tw9903.c 2021-02-04 17:41:59.000000000 +0000 @@ -187,10 +187,10 @@ static const struct v4l2_subdev_core_ops tw9903_core_ops = { .log_status = tw9903_log_status, - .s_std = tw9903_s_std, }; static const struct v4l2_subdev_video_ops tw9903_video_ops = { + .s_std = tw9903_s_std, .s_routing = tw9903_s_video_routing, }; @@ -215,7 +215,7 @@ v4l_info(client, "chip found @ 0x%02x (%s)\n", client->addr << 1, client->adapter->name); - dec = kzalloc(sizeof(struct tw9903), GFP_KERNEL); + dec = devm_kzalloc(&client->dev, sizeof(*dec), GFP_KERNEL); if (dec == NULL) return -ENOMEM; sd = &dec->sd; @@ -233,7 +233,6 @@ int err = hdl->error; v4l2_ctrl_handler_free(hdl); - kfree(dec); return err; } @@ -242,7 +241,6 @@ if (write_regs(sd, initial_registers) < 0) { v4l2_err(client, "error initializing TW9903\n"); - kfree(dec); return -EINVAL; } @@ -255,7 +253,6 @@ v4l2_device_unregister_subdev(sd); v4l2_ctrl_handler_free(&to_state(sd)->hdl); - kfree(to_state(sd)); return 0; } @@ -269,7 +266,6 @@ static struct i2c_driver tw9903_driver = { .driver = { - .owner = THIS_MODULE, .name = "tw9903", }, .probe = tw9903_probe,