Skip to content

Commit 4ad9a28

Browse files
committed
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
2 parents e07cd2f + 00b8c55 commit 4ad9a28

File tree

5 files changed

+21
-29
lines changed

5 files changed

+21
-29
lines changed

drivers/staging/comedi/comedi_fops.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,9 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32,
29872987
v32.chanlist_len = cmd->chanlist_len;
29882988
v32.data = ptr_to_compat(cmd->data);
29892989
v32.data_len = cmd->data_len;
2990-
return copy_to_user(cmd32, &v32, sizeof(v32));
2990+
if (copy_to_user(cmd32, &v32, sizeof(v32)))
2991+
return -EFAULT;
2992+
return 0;
29912993
}
29922994

29932995
/* Handle 32-bit COMEDI_CMD ioctl. */

drivers/staging/hikey9xx/hisi-spmi-controller.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,21 +278,24 @@ static int spmi_controller_probe(struct platform_device *pdev)
278278
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
279279
if (!iores) {
280280
dev_err(&pdev->dev, "can not get resource!\n");
281-
return -EINVAL;
281+
ret = -EINVAL;
282+
goto err_put_controller;
282283
}
283284

284285
spmi_controller->base = devm_ioremap(&pdev->dev, iores->start,
285286
resource_size(iores));
286287
if (!spmi_controller->base) {
287288
dev_err(&pdev->dev, "can not remap base addr!\n");
288-
return -EADDRNOTAVAIL;
289+
ret = -EADDRNOTAVAIL;
290+
goto err_put_controller;
289291
}
290292

291293
ret = of_property_read_u32(pdev->dev.of_node, "spmi-channel",
292294
&spmi_controller->channel);
293295
if (ret) {
294296
dev_err(&pdev->dev, "can not get channel\n");
295-
return -ENODEV;
297+
ret = -ENODEV;
298+
goto err_put_controller;
296299
}
297300

298301
platform_set_drvdata(pdev, spmi_controller);
@@ -309,9 +312,15 @@ static int spmi_controller_probe(struct platform_device *pdev)
309312
ctrl->write_cmd = spmi_write_cmd;
310313

311314
ret = spmi_controller_add(ctrl);
312-
if (ret)
313-
dev_err(&pdev->dev, "spmi_add_controller failed with error %d!\n", ret);
315+
if (ret) {
316+
dev_err(&pdev->dev, "spmi_controller_add failed with error %d!\n", ret);
317+
goto err_put_controller;
318+
}
319+
320+
return 0;
314321

322+
err_put_controller:
323+
spmi_controller_put(ctrl);
315324
return ret;
316325
}
317326

@@ -320,7 +329,7 @@ static int spmi_del_controller(struct platform_device *pdev)
320329
struct spmi_controller *ctrl = platform_get_drvdata(pdev);
321330

322331
spmi_controller_remove(ctrl);
323-
kfree(ctrl);
332+
spmi_controller_put(ctrl);
324333
return 0;
325334
}
326335

drivers/staging/media/atomisp/pci/atomisp_subdev.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,26 +1062,6 @@ static const struct v4l2_ctrl_config ctrl_select_isp_version = {
10621062
.def = 0,
10631063
};
10641064

1065-
#if 0 /* #ifdef CONFIG_ION */
1066-
/*
1067-
* Control for ISP ion device fd
1068-
*
1069-
* userspace will open ion device and pass the fd to kernel.
1070-
* this fd will be used to map shared fd to buffer.
1071-
*/
1072-
/* V4L2_CID_ATOMISP_ION_DEVICE_FD is not defined */
1073-
static const struct v4l2_ctrl_config ctrl_ion_dev_fd = {
1074-
.ops = &ctrl_ops,
1075-
.id = V4L2_CID_ATOMISP_ION_DEVICE_FD,
1076-
.type = V4L2_CTRL_TYPE_INTEGER,
1077-
.name = "Ion Device Fd",
1078-
.min = -1,
1079-
.max = 1024,
1080-
.step = 1,
1081-
.def = ION_FD_UNSET
1082-
};
1083-
#endif
1084-
10851065
static void atomisp_init_subdev_pipe(struct atomisp_sub_device *asd,
10861066
struct atomisp_video_pipe *pipe, enum v4l2_buf_type buf_type)
10871067
{

drivers/staging/mt7621-dma/mtk-hsdma.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
712712
ret = dma_async_device_register(dd);
713713
if (ret) {
714714
dev_err(&pdev->dev, "failed to register dma device\n");
715-
return ret;
715+
goto err_uninit_hsdma;
716716
}
717717

718718
ret = of_dma_controller_register(pdev->dev.of_node,
@@ -728,6 +728,8 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
728728

729729
err_unregister:
730730
dma_async_device_unregister(dd);
731+
err_uninit_hsdma:
732+
mtk_hsdma_uninit(hsdma);
731733
return ret;
732734
}
733735

kernel/configs/android-recommended.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ CONFIG_INPUT_JOYSTICK=y
8181
CONFIG_INPUT_MISC=y
8282
CONFIG_INPUT_TABLET=y
8383
CONFIG_INPUT_UINPUT=y
84-
CONFIG_ION=y
8584
CONFIG_JOYSTICK_XPAD=y
8685
CONFIG_JOYSTICK_XPAD_FF=y
8786
CONFIG_JOYSTICK_XPAD_LEDS=y

0 commit comments

Comments
 (0)