Re: [PATCH v3] media: allegro: add missed checks in allegro_open()

2020-01-21 Thread Chuhong Yuan
On Tue, Jan 21, 2020 at 4:23 PM Michael Tretter wrote: > > On Mon, 13 Jan 2020 13:59:51 +0800, Chuhong Yuan wrote: > > allegro_open() misses checks for v4l2_m2m_ctx_init() and results of > > v4l2_ctrl_new* calls. > > Add checks and error handlers to fix the problem

[PATCH v3] media: allegro: add missed checks in allegro_open()

2020-01-12 Thread Chuhong Yuan
allegro_open() misses checks for v4l2_m2m_ctx_init() and results of v4l2_ctrl_new* calls. Add checks and error handlers to fix the problems. Signed-off-by: Chuhong Yuan --- Changes in v3: - Make code cleaner. - Add a check for handler->error. .../staging/media/allegro-dvt/allegro-cor

[PATCH] staging: comedi: comedi_test: return error when comedi_test_init fails

2019-12-10 Thread Chuhong Yuan
comedi_test_init() forgets to return error when it fails. Modify the return value to fix it. Fixes: 9ff7400bd38c ("Staging: comedi: drivers: comedi_test: Add auto-configuration capability") Signed-off-by: Chuhong Yuan --- drivers/staging/comedi/drivers/comedi_test.c | 4 +++- 1 file

[PATCH v2] media: allegro: add the missed check for v4l2_m2m_ctx_init

2019-12-09 Thread Chuhong Yuan
allegro_open() misses a check for v4l2_m2m_ctx_init(). Add a check and error handling code to fix it. Fixes: f20387dfd065 ("media: allegro: add Allegro DVT video IP core driver") Signed-off-by: Chuhong Yuan --- Changes in v2: - Fix the use-after-free in v1. drivers/staging/media/a

[PATCH] media: imx7-mipi-csis: Add the missed v4l2_async_notifier_cleanup in remove

2019-12-09 Thread Chuhong Yuan
All drivers in imx call v4l2_async_notifier_cleanup() after unregistering the notifier except this driver. This should be a miss and we need to add the call to fix it. Signed-off-by: Chuhong Yuan --- drivers/staging/media/imx/imx7-mipi-csis.c | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH] media: allegro: add the missed check for v4l2_m2m_ctx_init

2019-12-09 Thread Chuhong Yuan
allegro_open() misses a check for v4l2_m2m_ctx_init(). Add a check and error handling code to fix it. Fixes: f20387dfd065 ("media: allegro: add Allegro DVT video IP core driver") Signed-off-by: Chuhong Yuan --- drivers/staging/media/allegro-dvt/allegro-core.c | 7 +++ 1 file

[PATCH] staging: rts5208: add missed pci_release_regions

2019-12-05 Thread Chuhong Yuan
The driver forgets to call pci_release_regions() in probe failure and remove. Add the missed calls to fix it. Signed-off-by: Chuhong Yuan --- drivers/staging/rts5208/rtsx.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers

[PATCH] staging: iio: ad9834: add a check for devm_clk_get

2019-10-16 Thread Chuhong Yuan
ad9834_probe misses a check for devm_clk_get and may cause problems. Add a check like what ad9832 does to fix it. Signed-off-by: Chuhong Yuan --- drivers/staging/iio/frequency/ad9834.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers

[PATCH v2] media: imx7-mipi-csis: Add a check for devm_regulator_get

2019-10-15 Thread Chuhong Yuan
devm_regulator_get may return an error but mipi_csis_phy_init misses a check for it. This may lead to problems when regulator_set_voltage uses the unchecked pointer. This patch adds a check for devm_regulator_get to avoid potential risk. Signed-off-by: Chuhong Yuan --- Changes in v2: - Add a

[PATCH] media: imx7-mipi-csis: Add a check for devm_regulator_get

2019-10-13 Thread Chuhong Yuan
devm_regulator_get may return an error but mipi_csis_phy_init misses a check for it. This may lead to problems when regulator_set_voltage uses the unchecked pointer. This patch adds a check for devm_regulator_get to avoid potential risk. Signed-off-by: Chuhong Yuan --- drivers/staging/media/imx

[PATCH] staging: iio: ad2s1210: Use device-managed API

2019-07-26 Thread Chuhong Yuan
Use device-managed API to simplify the code. The remove function is redundant now and can be deleted. Signed-off-by: Chuhong Yuan --- drivers/staging/iio/resolver/ad2s1210.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1210.c

[PATCH v2] staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32

2019-07-24 Thread Chuhong Yuan
Merge the combo use of memcpy and le32_to_cpus. Use get_unaligned_le32 instead. This simplifies the code. Signed-off-by: Chuhong Yuan --- Changes in v2: - Merge the previous two patches which have the same subject line. drivers/staging/wilc1000/wilc_mon.c | 3 +-- drivers

[PATCH v2] staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32

2019-07-24 Thread Chuhong Yuan
Merge the combo use of memcpy and le32_to_cpus. Use get_unaligned_le32 instead. This simplifies the code. Signed-off-by: Chuhong Yuan --- drivers/staging/wilc1000/wilc_mon.c | 3 +-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 +-- drivers/staging/wilc1000/wilc_wlan.c

[PATCH] media: staging/intel-ipu3: Use dev_get_drvdata where possible

2019-07-24 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/staging/media/ipu3/ipu3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c

[PATCH v2] staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32

2019-07-19 Thread Chuhong Yuan
Merge the combo use of memcpy and le32_to_cpus. Use get_unaligned_le32 instead. This simplifies the code. Signed-off-by: Chuhong Yuan --- Changes in v2: - Merge the two patches with the same subject line. drivers/staging/wilc1000/wilc_mon.c | 3 +-- drivers/staging/wilc1000

Re: [PATCH] staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32

2019-07-19 Thread Chuhong Yuan
于2019年7月19日周五 下午7:34写道: > > On 7/19/2019 1:40 PM, Chuhong Yuan wrote: > > > > Merge the combo use of memcpy and le32_to_cpus. > > Use get_unaligned_le32 instead. > > This simplifies the code. > > > > Signed-off-by: Chuhong Yuan > > --- > >

[PATCH] staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32

2019-07-19 Thread Chuhong Yuan
Merge the combo use of memcpy and le32_to_cpus. Use get_unaligned_le32 instead. This simplifies the code. Signed-off-by: Chuhong Yuan --- drivers/staging/wilc1000/wilc_mon.c | 3 +-- drivers/staging/wilc1000/wilc_wlan.c | 9 +++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff

[PATCH] staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32

2019-07-19 Thread Chuhong Yuan
Merge the combo use of memcpy and le32_to_cpus. Use get_unaligned_le32 instead. This simplifies the code. Signed-off-by: Chuhong Yuan --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000

[PATCH] staging: rtl8712: Merge memcpy + be16_to_cpus to get_unaligned_be16

2019-07-19 Thread Chuhong Yuan
Merge the combo of memcpy and be16_to_cpus. Use get_unaligned_be16 instead. This simplifies the code. Signed-off-by: Chuhong Yuan --- drivers/staging/rtl8712/rtl871x_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers