[PATCH 1/2] tpm: replace kmalloc() + memcpy() with kmemdup()

2018-05-08 Thread Ji-Hun Kim
Use kmemdup rather than duplicating its implementation. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- drivers/char/tpm/eventlog/of.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/tpm/eventlog/of.c b/drivers/char/tpm/eventlog/of.c index b

[PATCH 1/2] tpm: replace kmalloc() + memcpy() with kmemdup()

2018-05-08 Thread Ji-Hun Kim
Use kmemdup rather than duplicating its implementation. Signed-off-by: Ji-Hun Kim --- drivers/char/tpm/eventlog/of.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/tpm/eventlog/of.c b/drivers/char/tpm/eventlog/of.c index b7cac47..bba5fba 100644 --- a/drivers

[PATCH 2/2] tpm: replace kmalloc() + memcpy() with kmemdup()

2018-05-08 Thread Ji-Hun Kim
Use kmemdup rather than duplicating its implementation. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- drivers/char/tpm/eventlog/efi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/tpm/eventlog/efi.c b/drivers/char/tpm/eventlog/efi.c index 6

[PATCH 2/2] tpm: replace kmalloc() + memcpy() with kmemdup()

2018-05-08 Thread Ji-Hun Kim
Use kmemdup rather than duplicating its implementation. Signed-off-by: Ji-Hun Kim --- drivers/char/tpm/eventlog/efi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/tpm/eventlog/efi.c b/drivers/char/tpm/eventlog/efi.c index 68f1e7e..3e673ab 100644

[PATCH] staging: ks7010: replace kmalloc() + memcpy() with kmemdup()

2018-04-05 Thread Ji-Hun Kim
Use kmemdup rather than duplicating its implementation. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- drivers/staging/ks7010/ks7010_sdio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_

[PATCH] staging: ks7010: replace kmalloc() + memcpy() with kmemdup()

2018-04-05 Thread Ji-Hun Kim
Use kmemdup rather than duplicating its implementation. Signed-off-by: Ji-Hun Kim --- drivers/staging/ks7010/ks7010_sdio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index b8f55a1..c8eb55b

[PATCH v5 2/2] staging: vt6655: add handling memory leak on vnt_start()

2018-04-05 Thread Ji-Hun Kim
There was no code for handling memory leaks of device_init_rings() and request_irq(). It needs to free allocated memory in the device_init_rings() , when request_irq() would be failed. Add freeing sequences of irq and device init rings. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --

[PATCH v5 2/2] staging: vt6655: add handling memory leak on vnt_start()

2018-04-05 Thread Ji-Hun Kim
There was no code for handling memory leaks of device_init_rings() and request_irq(). It needs to free allocated memory in the device_init_rings() , when request_irq() would be failed. Add freeing sequences of irq and device init rings. Signed-off-by: Ji-Hun Kim --- It's additional memory leak

[PATCH v5 1/2] staging: vt6655: check for memory allocation failures

2018-04-05 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Implement error handling code on device_init_rd*, device_init_td* and vnt_start for the allocation failures. Signed-off-by: Ji-Hun Kim <ji_

[PATCH v5 1/2] staging: vt6655: check for memory allocation failures

2018-04-05 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Implement error handling code on device_init_rd*, device_init_td* and vnt_start for the allocation failures. Signed-off-by: Ji-Hun Kim --- Changes

Re: [PATCH v3] staging: vt6655: check for memory allocation failures

2018-04-04 Thread Ji-Hun Kim
On Tue, Apr 03, 2018 at 01:40:52PM +0300, Dan Carpenter wrote: > > desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_KERNEL); > > - > > + if (!desc->rd_info) { > > + ret = -ENOMEM; > > + goto error; > > + } > > if

Re: [PATCH v3] staging: vt6655: check for memory allocation failures

2018-04-04 Thread Ji-Hun Kim
On Tue, Apr 03, 2018 at 01:40:52PM +0300, Dan Carpenter wrote: > > desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_KERNEL); > > - > > + if (!desc->rd_info) { > > + ret = -ENOMEM; > > + goto error; > > + } > > if

[PATCH v4 2/2] staging: vt6655: add handling memory leak on vnt_start()

2018-03-29 Thread Ji-Hun Kim
There was no code for handling memory leaks of device_init_rings() and request_irq(). It needs to free allocated memory in the device_init_rings() , when request_irq() is failed. Add freeing sequences of irq and device init rings. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --

[PATCH v4 2/2] staging: vt6655: add handling memory leak on vnt_start()

2018-03-29 Thread Ji-Hun Kim
There was no code for handling memory leaks of device_init_rings() and request_irq(). It needs to free allocated memory in the device_init_rings() , when request_irq() is failed. Add freeing sequences of irq and device init rings. Signed-off-by: Ji-Hun Kim --- It's additional memory leak

[PATCH v4 1/2] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Implement error handling code on device_init_rd*, device_init_td* and vnt_start for the allocation failures. Signed-off-by: Ji-Hun Kim <ji_

[PATCH v4 1/2] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Implement error handling code on device_init_rd*, device_init_td* and vnt_start for the allocation failures. Signed-off-by: Ji-Hun Kim --- Changes

Re: [PATCH v3] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
On Fri, Mar 30, 2018 at 11:15:03AM +0800, Jia-Ju Bai wrote: > > > On 2018/3/30 10:44, Ji-Hun Kim wrote: > >@@ -1165,10 +1205,18 @@ static int vnt_start(struct ieee80211_hw *hw) > > } > > dev_dbg(>pcid->dev, "call device init rd0 ring\

Re: [PATCH v3] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
On Fri, Mar 30, 2018 at 11:15:03AM +0800, Jia-Ju Bai wrote: > > > On 2018/3/30 10:44, Ji-Hun Kim wrote: > >@@ -1165,10 +1205,18 @@ static int vnt_start(struct ieee80211_hw *hw) > > } > > dev_dbg(>pcid->dev, "call device init rd0 ring\

Re: [PATCH v3] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
On Fri, Mar 30, 2018 at 11:15:03AM +0800, Jia-Ju Bai wrote: > > > On 2018/3/30 10:44, Ji-Hun Kim wrote: > >@@ -1165,10 +1205,18 @@ static int vnt_start(struct ieee80211_hw *hw) > > } > > dev_dbg(>pcid->dev, "call device init rd0 ring\

Re: [PATCH v3] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
On Fri, Mar 30, 2018 at 11:15:03AM +0800, Jia-Ju Bai wrote: > > > On 2018/3/30 10:44, Ji-Hun Kim wrote: > >@@ -1165,10 +1205,18 @@ static int vnt_start(struct ieee80211_hw *hw) > > } > > dev_dbg(>pcid->dev, "call device init rd0 ring\

[PATCH v3] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Implement error handling code on device_init_rd*, device_init_td* and vnt_start for the allocation failures. Signed-off-by: Ji-Hun Kim <ji_

[PATCH v3] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Implement error handling code on device_init_rd*, device_init_td* and vnt_start for the allocation failures. Signed-off-by: Ji-Hun Kim --- Changes

Re: [PATCH v2] staging: vt6655: check for memory allocation failures

2018-03-29 Thread ji-hun Kim
2018-03-29 17:00 GMT+09:00 Jia-Ju Bai <baijiaju1...@gmail.com>: > > > > On 2018/3/29 15:22, Ji-Hun Kim wrote: >> >> There are no null pointer checking on rd_info and td_info values which >> are allocated by kzalloc. It has potential null pointer dereferencing &

Re: [PATCH v2] staging: vt6655: check for memory allocation failures

2018-03-29 Thread ji-hun Kim
2018-03-29 17:00 GMT+09:00 Jia-Ju Bai : > > > > On 2018/3/29 15:22, Ji-Hun Kim wrote: >> >> There are no null pointer checking on rd_info and td_info values which >> are allocated by kzalloc. It has potential null pointer dereferencing >> issues. Add return whe

[PATCH v2] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Add return when allocation is failed. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- Change: since v1: - Delete WARN_ON which can

[PATCH v2] staging: vt6655: check for memory allocation failures

2018-03-29 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Add return when allocation is failed. Signed-off-by: Ji-Hun Kim --- Change: since v1: - Delete WARN_ON which can makes crashes on some machines

Re: [PATCH] staging: vt6655: check for memory allocation failures

2018-03-28 Thread Ji-Hun Kim
On Wed, Mar 28, 2018 at 05:55:57PM +0800, Jia-Ju Bai wrote: > >@@ -646,7 +649,8 @@ static void device_init_td1_ring(struct vnt_private > >*priv) > > i++, curr += sizeof(struct vnt_tx_desc)) { > > desc = >apTD1Rings[i]; > > desc->td_info =

Re: [PATCH] staging: vt6655: check for memory allocation failures

2018-03-28 Thread Ji-Hun Kim
On Wed, Mar 28, 2018 at 05:55:57PM +0800, Jia-Ju Bai wrote: > >@@ -646,7 +649,8 @@ static void device_init_td1_ring(struct vnt_private > >*priv) > > i++, curr += sizeof(struct vnt_tx_desc)) { > > desc = >apTD1Rings[i]; > > desc->td_info =

[PATCH] staging: vt6655: check for memory allocation failures

2018-03-28 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Add return when allocation is failed. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- drivers/staging/vt6655/device_main.

[PATCH] staging: vt6655: check for memory allocation failures

2018-03-28 Thread Ji-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Add return when allocation is failed. Signed-off-by: Ji-Hun Kim --- drivers/staging/vt6655/device_main.c | 12 1 file changed, 8

Re: [PATCH v3 1/2] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-26 Thread Ji-Hun Kim
On Wed, Mar 21, 2018 at 01:39:09PM +0900, Ji-Hun Kim wrote: > There is no failure checking on the param value which will be allocated > memory by kmalloc. Add a null pointer checking statement. Then goto error: > and return -ENOMEM error code when kmalloc is failed. > > Signed-off

Re: [PATCH v3 1/2] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-26 Thread Ji-Hun Kim
On Wed, Mar 21, 2018 at 01:39:09PM +0900, Ji-Hun Kim wrote: > There is no failure checking on the param value which will be allocated > memory by kmalloc. Add a null pointer checking statement. Then goto error: > and return -ENOMEM error code when kmalloc is failed. > > Signed-off

[PATCH v3 2/2] staging: media: davinci_vpfe: add kfree() on goto err statement

2018-03-20 Thread Ji-Hun Kim
It needs to free of allocated params value in the goto error statement. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- Changes since v2: - add kfree(params) on the error case of the function - rename unclear goto statement name - declare the params value at start of the functi

[PATCH v3 2/2] staging: media: davinci_vpfe: add kfree() on goto err statement

2018-03-20 Thread Ji-Hun Kim
It needs to free of allocated params value in the goto error statement. Signed-off-by: Ji-Hun Kim --- Changes since v2: - add kfree(params) on the error case of the function - rename unclear goto statement name - declare the params value at start of the function, so it can be free end

[PATCH v3 1/2] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-20 Thread Ji-Hun Kim
There is no failure checking on the param value which will be allocated memory by kmalloc. Add a null pointer checking statement. Then goto error: and return -ENOMEM error code when kmalloc is failed. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- Changes since v1: - Return with -

[PATCH v3 1/2] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-20 Thread Ji-Hun Kim
There is no failure checking on the param value which will be allocated memory by kmalloc. Add a null pointer checking statement. Then goto error: and return -ENOMEM error code when kmalloc is failed. Signed-off-by: Ji-Hun Kim --- Changes since v1: - Return with -ENOMEM directly, instead

[PATCH v2] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-18 Thread Ji-Hun Kim
There is no failure checking on the param value which will be allocated memory by kmalloc. Add a null pointer checking statement. Then goto error: and return -ENOMEM error code when kmalloc is failed. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- Changes since v1: - Return with -

[PATCH v2] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-18 Thread Ji-Hun Kim
There is no failure checking on the param value which will be allocated memory by kmalloc. Add a null pointer checking statement. Then goto error: and return -ENOMEM error code when kmalloc is failed. Signed-off-by: Ji-Hun Kim --- Changes since v1: - Return with -ENOMEM directly, instead

Re: Re: [PATCH] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-18 Thread Ji-Hun Kim
On Fri, Mar 16, 2018 at 11:32:34AM +0300, Dan Carpenter wrote: > On Fri, Mar 16, 2018 at 01:58:23PM +0900, Ji-Hun Kim wrote: > > There is no failure checking on the param value which will be allocated > > memory by kmalloc. Add a null pointer checking statement. Then goto error:

Re: Re: [PATCH] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-18 Thread Ji-Hun Kim
On Fri, Mar 16, 2018 at 11:32:34AM +0300, Dan Carpenter wrote: > On Fri, Mar 16, 2018 at 01:58:23PM +0900, Ji-Hun Kim wrote: > > There is no failure checking on the param value which will be allocated > > memory by kmalloc. Add a null pointer checking statement. Then goto error:

[PATCH] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-15 Thread Ji-Hun Kim
There is no failure checking on the param value which will be allocated memory by kmalloc. Add a null pointer checking statement. Then goto error: and return -ENOMEM error code when kmalloc is failed. Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- drivers/staging/media/davinc

[PATCH] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-15 Thread Ji-Hun Kim
There is no failure checking on the param value which will be allocated memory by kmalloc. Add a null pointer checking statement. Then goto error: and return -ENOMEM error code when kmalloc is failed. Signed-off-by: Ji-Hun Kim --- drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 8 1

[PATCH] staging: rtl8723bs: core: rtw_cmd: remove unnecessary initialization

2018-03-13 Thread Ji-Hun Kim
Clean up checkpatch error: ERROR: do not initialise globals to 0 Signed-off-by: Ji-Hun Kim <ji_hun@samsung.com> --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/s

[PATCH] staging: rtl8723bs: core: rtw_cmd: remove unnecessary initialization

2018-03-13 Thread Ji-Hun Kim
Clean up checkpatch error: ERROR: do not initialise globals to 0 Signed-off-by: Ji-Hun Kim --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index

[PATCH 2/2] staging: iio: add spaces around '-' operator

2017-12-27 Thread Ji-Hun Kim
Clean up checkpatch warning: CHECK: spaces preferred around that '-' (ctx:VxV) Signed-off-by: Ji-Hun Kim <jihuu...@gmail.com> --- drivers/staging/iio/adc/ad7192.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/

[PATCH 2/2] staging: iio: add spaces around '-' operator

2017-12-27 Thread Ji-Hun Kim
Clean up checkpatch warning: CHECK: spaces preferred around that '-' (ctx:VxV) Signed-off-by: Ji-Hun Kim --- drivers/staging/iio/adc/ad7192.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index f015955

[PATCH 1/2] staging: iio: remove unnecessary parentheses

2017-12-27 Thread Ji-Hun Kim
Clean up checkpatch warning: CHECK: Unnecessary parentheses around 'st->devid != ID_AD7195' Signed-off-by: Ji-Hun Kim <jihuu...@gmail.com> --- drivers/staging/iio/adc/ad7192.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/driver

[PATCH 1/2] staging: iio: remove unnecessary parentheses

2017-12-27 Thread Ji-Hun Kim
Clean up checkpatch warning: CHECK: Unnecessary parentheses around 'st->devid != ID_AD7195' Signed-off-by: Ji-Hun Kim --- drivers/staging/iio/adc/ad7192.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad719

[PATCH 3/3] staging: irda: separate multiple assignments

2017-12-26 Thread JI-HUN KIM
Clean up checkpatch warning: CHECK: multiple assignments should be avoided Signed-off-by: JI-HUN KIM <jihuu...@gmail.com> --- drivers/staging/irda/drivers/esi-sir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/irda/drivers/esi-sir.c b/drivers/s

[PATCH 3/3] staging: irda: separate multiple assignments

2017-12-26 Thread JI-HUN KIM
Clean up checkpatch warning: CHECK: multiple assignments should be avoided Signed-off-by: JI-HUN KIM --- drivers/staging/irda/drivers/esi-sir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/irda/drivers/esi-sir.c b/drivers/staging/irda/drivers/esi-sir.c

[PATCH 2/3] staging: irda: add spaces around '|' operator

2017-12-26 Thread JI-HUN KIM
Clean up checkpatch warning: CHECK: spaces preferred around that '|' (ctx:VxV) Signed-off-by: JI-HUN KIM <jihuu...@gmail.com> --- drivers/staging/irda/drivers/esi-sir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/irda/drivers/esi-sir.c b/drivers/s

[PATCH 2/3] staging: irda: add spaces around '|' operator

2017-12-26 Thread JI-HUN KIM
Clean up checkpatch warning: CHECK: spaces preferred around that '|' (ctx:VxV) Signed-off-by: JI-HUN KIM --- drivers/staging/irda/drivers/esi-sir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/irda/drivers/esi-sir.c b/drivers/staging/irda/drivers/esi

[PATCH 1/3] staging: irda: fix type from "unsigned" to "unsigned int"

2017-12-26 Thread JI-HUN KIM
Clean up checkpatch warning: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: JI-HUN KIM <jihuu...@gmail.com> --- drivers/staging/irda/drivers/esi-sir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/irda/drivers/esi-si

[PATCH 1/3] staging: irda: fix type from "unsigned" to "unsigned int"

2017-12-26 Thread JI-HUN KIM
Clean up checkpatch warning: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: JI-HUN KIM --- drivers/staging/irda/drivers/esi-sir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/irda/drivers/esi-sir.c b/drivers/staging/irda