[PATCH 0/6] Fix issues reported by static analysis tool.

2018-05-22 Thread Pankaj Bharadiya
This patch series fixes some of the issues reported by static analysis tool. Pankaj Bharadiya (6): media: staging: atomisp: remove redundent check media: staging: atomisp: Remove useless if statement media: staging: atomisp: Remove useless "ifndef ISP2401" media: staging: at

[PATCH 2/6] media: staging: atomisp: Remove useless if statement

2018-05-22 Thread Pankaj Bharadiya
Local variable "requeue" is assigned only once to a constant "false" value so "if(requeue)" condition will never be true. Thus remove it. Signed-off-by: Pankaj Bharadiya --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 14 -- 1 file change

[PATCH 5/6] media: staging: atomisp: Fix potential NULL pointer dereference

2018-05-22 Thread Pankaj Bharadiya
In sh_css_config_input_network(), "stream" is being dereferenced before it is null checked. Fix it by moving the "stream" pointer dereference after it has been properly null checked. Signed-off-by: Pankaj Bharadiya --- drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_c

[PATCH 4/6] media: staging: atomisp: Fix potential NULL pointer dereference

2018-05-22 Thread Pankaj Bharadiya
In ia_css_pipe_get_primary_binarydesc(), "pipe" is being dereferenced before it is null checked. Fix it by moving the "pipe" pointer dereference after it has been properly null checked. Signed-off-by: Pankaj Bharadiya --- .../atomisp/pci/atomisp2/css2400/camera/pipe/s

[PATCH 6/6] media: staging: atomisp: Fix potential NULL pointer dereference

2018-05-22 Thread Pankaj Bharadiya
In verify_copy_out_frame_format(), "pipe" is being dereferenced before it is null checked. Fix it by moving the "pipe" pointer dereference after it has been properly null checked. Signed-off-by: Pankaj Bharadiya --- drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_cs

[PATCH 1/6] media: staging: atomisp: remove redundent check

2018-05-22 Thread Pankaj Bharadiya
Assignment asd = &isp->asd[i] can never be null hence remove redundent check. Signed-off-by: Pankaj Bharadiya --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/a

[PATCH 3/6] media: staging: atomisp: Remove useless "ifndef ISP2401"

2018-05-22 Thread Pankaj Bharadiya
In atomisp_csi2_set_ffmt(), there is no reason to have "#ifndef ISP2401" condition since code is identical in ifndef and else sections. Hence remove redudent checks. Signed-off-by: Pankaj Bharadiya --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_csi2.c | 8 1 file

[PATCH 0/5] Add and use sizeof_member macro to bring uniformity

2019-09-24 Thread Pankaj Bharadiya
of above 3 macros where used with newly introduced sizeof_member macro - removes definitions of SIZEOF_FIELD, FIELD_SIZEOF, sizeof_field This series aims to fix the issue based on given comments in [1]. [1] Link: https://www.openwall.com/lists/kernel-hardening/2019/07/02/2 Pankaj Bharadiya

[PATCH 2/5] treewide: Use sizeof_member macro

2019-09-24 Thread Pankaj Bharadiya
~ $EXCLUDE_FILES ]]; then continue fi sed -i -e 's/\bFIELD_SIZEOF\b/sizeof_member/g' \ -e 's/\bsizeof_field\b/sizeof_member/g' \ -e 's/\bSIZEOF_FIELD\b/sizeof_member/g' $file; done Signed-off-by: Pankaj Bharadiya

[PATCH 4/5] linux/kernel.h: Remove FIELD_SIZEOF macro

2019-09-24 Thread Pankaj Bharadiya
Now we have sizeof_member macro to find the size of a member of a struct. FIELD_SIZEOF macro is not getting used any more hence remove it. Signed-off-by: Pankaj Bharadiya --- include/linux/kernel.h | 9 - 1 file changed, 9 deletions(-) diff --git a/include/linux/kernel.h b/include

[PATCH 3/5] MIPS: OCTEON: use sizeof_member macro instead of SIZEOF_FIELD

2019-09-24 Thread Pankaj Bharadiya
Now we have a standard sizeof_member macro to find the size of a member of a struct. Remove the SIZEOF_FIELD macro and use sizeof_member instead. Signed-off-by: Pankaj Bharadiya --- arch/mips/cavium-octeon/executive/cvmx-bootmem.c | 9 + 1 file changed, 1 insertion(+), 8 deletions

[PATCH 1/5] linux/kernel.h: Add sizeof_member macro

2019-09-24 Thread Pankaj Bharadiya
re patches. Signed-off-by: Pankaj Bharadiya --- include/linux/kernel.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4fa360a13c1e..0b80d8bb3978 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -7

[PATCH 5/5] stddef.h: Remove sizeof_field macro

2019-09-24 Thread Pankaj Bharadiya
Now we have sizeof_member macro to find the size of a member of a struct. sizeof_field macro is not getting used any more hence remove it. Also modify the offsetofend macro to get rid of it. Signed-off-by: Pankaj Bharadiya --- include/linux/stddef.h | 10 +- 1 file changed, 1

[PATCH] ASoC: dapm: Fix NULL pointer dereference in snd_soc_dapm_new_dai

2019-03-21 Thread Pankaj Bharadiya
In case of single config, w_param_text is NULL. In snd_soc_dapm_new_control_unlocked() call failure case, it will end up calling snd_soc_dapm_free_kcontrol() unconditionally and result in NULL pointer dereference. Signed-off-by: Pankaj Bharadiya --- sound/soc/soc-dapm.c | 5 +++-- 1 file

[PATCH] ASoC: dapm: Fix NULL pointer dereference in snd_soc_dapm_free_kcontrol

2019-03-22 Thread Pankaj Bharadiya
w_text_param can be NULL and it is being dereferenced without checking. Add the missing sanity check to prevent NULL pointer dereference. Signed-off-by: Pankaj Bharadiya --- sound/soc/soc-dapm.c | 4 1 file changed, 4 insertions(+) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c

[PATCH] ASoC: dapm: Initialize private_value in snd_soc_dapm_new_dai

2019-03-22 Thread Pankaj Bharadiya
In case of single config, private_value is left uninitialized. The private_value does need to be initialized or in snd_soc_dapm_new_control_unlocked() call failure case, it leads to a bogus free in snd_soc_dapm_free_kcontrol() Signed-off-by: Pankaj Bharadiya --- sound/soc/soc-dapm.c | 2 +- 1

[PATCH] staging: greybus: audio: Rename cport with intf_id

2016-10-16 Thread Pankaj Bharadiya
gb_audio_manager_module_descriptor's cport field is actually used to manage and pass interface id to user space. Thus rename gb_audio_manager_module_descriptor's 'cport' field and few other things to avoid confusion. Signed-off-by: Pankaj Bharadiya --- drivers/staging/gre

[PATCH] staging: dgnc: Replace CamelCase namings with underscores.

2016-10-16 Thread Pankaj Bharadiya
Replace CamelCase names with underscores to comply with the standard kernel coding style. Signed-off-by: Pankaj Bharadiya --- drivers/staging/dgnc/dgnc_tty.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers

[PATCH] staging: greybus: audio: remove redundant slot field

2016-10-17 Thread Pankaj Bharadiya
gb_audio_manager_module_descriptor's intf_id field maintains the information about the interface on which module is connected hence having an extra slot field is redundant. Thus remove the slot field and its associated code. Signed-off-by: Pankaj Bharadiya --- drivers/staging/gr

[PATCH v2 0/2] staging: dgnc: Code cleaup

2016-10-17 Thread Pankaj Bharadiya
Hi, This patchset does minor cleanup for dgnc driver. v1->v2: - Split into multiple patches - remove redundant dgnc_tmp_write_buf variable and function calls - rename dgnc_default_termios to default_termios Pankaj Bharadiya (2): staging: dgnc: Remove some redundant functions staging: d

[PATCH v2 1/2] staging: dgnc: Remove some redundant functions

2016-10-17 Thread Pankaj Bharadiya
dgnc_tty_preinit() and dgnc_tty_post_uninit() functions are used to allocate and free "dgnc_TmpWriteBuf" and this "dgnc_TmpWriteBuf" is not really getting used. Hence remove these redundant functions. Also remove dgnc_TmpWriteBuf variable as it is not used anymore. S

[PATCH v2 2/2] staging: dgnc: Replace CamelCase namings with underscores

2016-10-17 Thread Pankaj Bharadiya
Replace CamelCase names with underscores to comply with the standard kernel coding style. Signed-off-by: Pankaj Bharadiya --- drivers/staging/dgnc/dgnc_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc

Re: [PATCH] staging: dgnc: Replace CamelCase namings with underscores.

2016-10-17 Thread Pankaj Bharadiya
On Mon, Oct 17, 2016 at 1:16 PM, Greg KH wrote: > > On Mon, Oct 17, 2016 at 01:13:55AM +0530, Pankaj Bharadiya wrote: > > Replace CamelCase names with underscores to comply with the standard > > kernel coding style. > > > > Signed-off-by: Pankaj Bharadiya >