Staging driver fixes for 5.11-rc3

Here are some small staging driver fixes for 5.11-rc3.  Nothing major,
 just resolving some reported issues:
 	- cleanup some remaining mentions of the ION drivers that were
 	  removed in 5.11-rc1
 	- comedi driver bugfix
 	- 2 error path memory leak fixes
 
 All have been in linux-next for a while with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCX/sJ2w8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynrXACZASkdHO71XqECukP73ajgRD81LbQAn3igZysN
 2gOnWLkJbYSoL1fDD3mx
 =Jeh8
 -----END PGP SIGNATURE-----

Merge tag 'staging-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are some small staging driver fixes for 5.11-rc3. Nothing major,
  just resolving some reported issues:

   - cleanup some remaining mentions of the ION drivers that were
     removed in 5.11-rc1

   - comedi driver bugfix

   - two error path memory leak fixes

  All have been in linux-next for a while with no reported issues"

* tag 'staging-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: ION: remove some references to CONFIG_ION
  staging: mt7621-dma: Fix a resource leak in an error handling path
  Staging: comedi: Return -EFAULT if copy_to_user() fails
  staging: spmi: hisi-spmi-controller: Fix some error handling paths
This commit is contained in:
Linus Torvalds 2021-01-10 12:28:07 -08:00
commit 4ad9a28f56
5 changed files with 21 additions and 29 deletions

View File

@ -2987,7 +2987,9 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32,
v32.chanlist_len = cmd->chanlist_len;
v32.data = ptr_to_compat(cmd->data);
v32.data_len = cmd->data_len;
return copy_to_user(cmd32, &v32, sizeof(v32));
if (copy_to_user(cmd32, &v32, sizeof(v32)))
return -EFAULT;
return 0;
}
/* Handle 32-bit COMEDI_CMD ioctl. */

View File

@ -278,21 +278,24 @@ static int spmi_controller_probe(struct platform_device *pdev)
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!iores) {
dev_err(&pdev->dev, "can not get resource!\n");
return -EINVAL;
ret = -EINVAL;
goto err_put_controller;
}
spmi_controller->base = devm_ioremap(&pdev->dev, iores->start,
resource_size(iores));
if (!spmi_controller->base) {
dev_err(&pdev->dev, "can not remap base addr!\n");
return -EADDRNOTAVAIL;
ret = -EADDRNOTAVAIL;
goto err_put_controller;
}
ret = of_property_read_u32(pdev->dev.of_node, "spmi-channel",
&spmi_controller->channel);
if (ret) {
dev_err(&pdev->dev, "can not get channel\n");
return -ENODEV;
ret = -ENODEV;
goto err_put_controller;
}
platform_set_drvdata(pdev, spmi_controller);
@ -309,9 +312,15 @@ static int spmi_controller_probe(struct platform_device *pdev)
ctrl->write_cmd = spmi_write_cmd;
ret = spmi_controller_add(ctrl);
if (ret)
dev_err(&pdev->dev, "spmi_add_controller failed with error %d!\n", ret);
if (ret) {
dev_err(&pdev->dev, "spmi_controller_add failed with error %d!\n", ret);
goto err_put_controller;
}
return 0;
err_put_controller:
spmi_controller_put(ctrl);
return ret;
}
@ -320,7 +329,7 @@ static int spmi_del_controller(struct platform_device *pdev)
struct spmi_controller *ctrl = platform_get_drvdata(pdev);
spmi_controller_remove(ctrl);
kfree(ctrl);
spmi_controller_put(ctrl);
return 0;
}

View File

@ -1062,26 +1062,6 @@ static const struct v4l2_ctrl_config ctrl_select_isp_version = {
.def = 0,
};
#if 0 /* #ifdef CONFIG_ION */
/*
* Control for ISP ion device fd
*
* userspace will open ion device and pass the fd to kernel.
* this fd will be used to map shared fd to buffer.
*/
/* V4L2_CID_ATOMISP_ION_DEVICE_FD is not defined */
static const struct v4l2_ctrl_config ctrl_ion_dev_fd = {
.ops = &ctrl_ops,
.id = V4L2_CID_ATOMISP_ION_DEVICE_FD,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "Ion Device Fd",
.min = -1,
.max = 1024,
.step = 1,
.def = ION_FD_UNSET
};
#endif
static void atomisp_init_subdev_pipe(struct atomisp_sub_device *asd,
struct atomisp_video_pipe *pipe, enum v4l2_buf_type buf_type)
{

View File

@ -712,7 +712,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
ret = dma_async_device_register(dd);
if (ret) {
dev_err(&pdev->dev, "failed to register dma device\n");
return ret;
goto err_uninit_hsdma;
}
ret = of_dma_controller_register(pdev->dev.of_node,
@ -728,6 +728,8 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
err_unregister:
dma_async_device_unregister(dd);
err_uninit_hsdma:
mtk_hsdma_uninit(hsdma);
return ret;
}

View File

@ -81,7 +81,6 @@ CONFIG_INPUT_JOYSTICK=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_TABLET=y
CONFIG_INPUT_UINPUT=y
CONFIG_ION=y
CONFIG_JOYSTICK_XPAD=y
CONFIG_JOYSTICK_XPAD_FF=y
CONFIG_JOYSTICK_XPAD_LEDS=y