[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

[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

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

2018-03-29 Thread Jia-Ju Bai
On 2018/3/30 11:39, Ji-Hun Kim wrote: 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\n"); -

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\n"); > >-device_init_rd0_ring(priv); > >-

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\n"); > >-device_init_rd0_ring(priv); > >-

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

2018-03-29 Thread Jia-Ju Bai
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\n"); - device_init_rd0_ring(priv); - device_init_rd1_ring(priv); - device_init_td0_ring(priv); -

[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

Re: [PATCH v4 10/13] usb: typec: tcpm: set cc for drp toggling attach

2018-03-29 Thread Guenter Roeck
On Thu, Mar 29, 2018 at 12:06:15AM +0800, Li Jun wrote: > In case of drp toggling, we may need set correct cc value for role control > after attach as it may never been set. > Isn't CC set by the lower level driver in this case ? In other words, is it ever necessary to call back into the low

Re: [PATCH v4 10/13] usb: typec: tcpm: set cc for drp toggling attach

2018-03-29 Thread Mats Karrman
Hi Li, On 03/28/2018 06:06 PM, Li Jun wrote: > In case of drp toggling, we may need set correct cc value for role control > after attach as it may never been set. > > Signed-off-by: Li Jun > --- > drivers/usb/typec/tcpm.c | 5 + > 1 file changed, 5 insertions(+) > > diff

Re: [PATCH v4 01/13] dt-bindings: connector: add properties for typec

2018-03-29 Thread Mats Karrman
Hi Li, On 03/28/2018 06:06 PM, Li Jun wrote: > Add bingdings supported by current typec driver, so user can pass > all those properties via dt. > > Signed-off-by: Li Jun > --- > .../bindings/connector/usb-connector.txt | 39 > ++ > 1 file changed,

[PATCH 1/6] staging: ks7010: replace IS_11B_RATE macro with inline function

2018-03-29 Thread Sergio Paracuellos
This commit replaces IS_11B_RATE macro with is_11b_rate inline function to improve readability. It also fix a checkpatch script warning because a line with more than 80 spaces. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 2 +-

[PATCH 2/6] staging: ks7010: replace IS_OFDM_RATE macro with inline function

2018-03-29 Thread Sergio Paracuellos
This commit replaces IS_OFDM_RATE macro with is_ofdm_rate inline function. This also fix checkpatch warning about more than 80 spaces line. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.h | 17 - 1 file changed, 12

[PATCH 4/6] staging: ks7010: IS_OFDM_EXT_RATE macro with inline function

2018-03-29 Thread Sergio Paracuellos
This commit replaces IS_OFDM_EXT_RATE macro with is_11b_rate inline function to improve readability. It also fix a checkpatch script warning because a line with more than 80 spaces. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 2 +-

[PATCH 3/6] staging: ks7010: replace IS_11BG_RATE macro with inline function

2018-03-29 Thread Sergio Paracuellos
This commit replaces IS_11BG_RATE macro with is_11b_rate inline function to improve readability. It also fix a checkpatch script warning because a line with more than 80 spaces. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.c | 2 +-

[PATCH 6/6] staging: ks7010: replace IS_HIF_CONF with inline function

2018-03-29 Thread Sergio Paracuellos
This commit replaces IS_HIF_CONF macro with is_11b_rate inline function to improve readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks7010_sdio.c | 2 +- drivers/staging/ks7010/ks_hostif.h | 12 +++- 2 files changed, 8

[PATCH 5/6] staging: ks7010: replace IS_HIF_IND with inline function

2018-03-29 Thread Sergio Paracuellos
This commit replaces IS_HIF_IND macro with is_11b_rate inline function to improve readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/ks7010/ks_hostif.h | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git

[PATCH 0/6] staging: ks7010: convert some macros into inline functions

2018-03-29 Thread Sergio Paracuellos
This patch series replace some macros with inline functions in ks_hostif.h header file and replace its uses along the source code. Sergio Paracuellos (6): staging: ks7010: replace IS_11B_RATE macro with inline function staging: ks7010: replace IS_OFDM_RATE macro with inline function

Re: [PATCH v4 04/13] usb: typec: add fwnode to tcpc

2018-03-29 Thread Heikki Krogerus
Hi, On Thu, Mar 29, 2018 at 12:06:09AM +0800, Li Jun wrote: > Add fwnode handle to get the fwnode so we can get typec configs > it contains. > > Suggested-by: Heikki Krogerus > Signed-off-by: Li Jun > --- > drivers/staging/typec/tcpci.c | 14

[PATCH v2] staging: mt7621-eth: Fix sparse warning in ethtool.c

2018-03-29 Thread Chris Coffey
This fixes the following sparse warning: drivers/staging/mt7621-eth/ethtool.c:213:6: warning: symbol 'mtk_set_ethtool_ops' was not declared. Should it be static? Signed-off-by: Chris Coffey --- Changes in v2: - Per GregKH's feedback (thanks!), don't add unnecessary new .h

Re: [PATCH] ANDROID: binder: re-order some conditions

2018-03-29 Thread Martijn Coenen
On Thu, Mar 29, 2018 at 11:14 AM, Dan Carpenter wrote: > It doesn't make any difference to runtime but I've switched these two > checks to make my static checker happy. > > The problem is that "buffer->data_size" is user controlled and if it's > less than "sizeo(*hdr)"

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 when allocation

Re: [PATCH v4 07/13] staging: typec: tcpci: register port before request irq

2018-03-29 Thread Dan Carpenter
On Thu, Mar 29, 2018 at 12:06:12AM +0800, Li Jun wrote: > With that we can clear any pending events and the port is registered > so driver can be ready to handle typec events once we request irq. > > Signed-off-by: Peter Chen > Signed-off-by: Li Jun These

Re: [PATCH] staging: mt7621-eth: Fix sparse warning in ethtool.c

2018-03-29 Thread Greg Kroah-Hartman
On Wed, Mar 28, 2018 at 10:18:48PM +0100, Chris Coffey wrote: > Include the local ethtool.h header file in mtk_eth_soc.h so > implementation files have centralized access to it. > > This fixes the following sparse warning: > > drivers/staging/mt7621-eth/ethtool.c:213:6: warning: symbol >

Re: [PATCH] Staging: comedi: ni_stc: Fixed comment coding style issue

2018-03-29 Thread Greg KH
On Mon, Mar 26, 2018 at 03:27:10PM +0200, Rene Hickersberger wrote: > Fixed a coding style issue where the comment * was not aligned. > > Signed-off-by: Rene Hickersberger > --- > drivers/staging/comedi/drivers/ni_stc.h | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [PATCH 7/9] staging: ks7010: Remove trailing "_t" from all structure names.

2018-03-29 Thread Greg KH
On Wed, Mar 28, 2018 at 10:51:50PM -0700, Quytelda Kahja wrote: > The "_t" suffix is not needed for structure names in this driver, > and is a reflection of an older typedef system that is no longer > in place. Remove the "_t" suffix from every structure defined in this > driver. Again, please

Re: [PATCH 3/9] staging: ks7010: Reorder ks_wlan_netdev_ops members.

2018-03-29 Thread Greg KH
On Wed, Mar 28, 2018 at 10:51:46PM -0700, Quytelda Kahja wrote: > Reorder the members of 'ks_wlan_netdev_ops' to reflect the order > of their counterparts in the kernel's 'struct net_device_ops'. Why? This shouldn't matter at all, why make this change? greg k-h

[PATCH v6 6/6] Staging: iio: adis16209: Move adis16209 driver out of staging

2018-03-29 Thread Shreeya Patel
Move the adis16209 driver out of staging directory and merge to the mainline IIO subsystem. Signed-off-by: Shreeya Patel --- Changes in v6 -Move driver adis16209 from staging to mainline IIO subsystem after complete cleanup of it. drivers/iio/accel/Kconfig

[PATCH v6 5/6] Staging: iio: adis16209: Use GENMASK

2018-03-29 Thread Shreeya Patel
Use GENMASK to improve readability and remove the local variables used to store intermediate data. Signed-off-by: Shreeya Patel --- Changes in v6 -Introduce this new patch in the series. drivers/staging/iio/accel/adis16209.c | 19 --- 1 file

[PATCH v6 4/6] Staging: iio: adis16209: Remove unused headers

2018-03-29 Thread Shreeya Patel
Remove few unused header files since the adis core handles the sysfs and buffer support. Signed-off-by: Shreeya Patel --- Changes in v6 -Introduce this new patch in the series. drivers/staging/iio/accel/adis16209.c | 3 --- 1 file changed, 3 deletions(-) diff

[PATCH] ANDROID: binder: re-order some conditions

2018-03-29 Thread Dan Carpenter
It doesn't make any difference to runtime but I've switched these two checks to make my static checker happy. The problem is that "buffer->data_size" is user controlled and if it's less than "sizeo(*hdr)" then that means "offset" can be more than "buffer->data_size". It's just cleaner to check

[PATCH v6 3/6] Staging: iio: adis16209: Add a blank line after return statements

2018-03-29 Thread Shreeya Patel
Add a blank line after return statements to improve the code readability. Signed-off-by: Shreeya Patel --- Changes in v6 -Introduce this new patch in the series. drivers/staging/iio/accel/adis16209.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v6 2/6] Staging: iio: adis16209: Prefer reverse christmas tree ordering

2018-03-29 Thread Shreeya Patel
Prefer reverse christmas tree ordering of declarations to improve readability. Signed-off-by: Shreeya Patel --- Changes in v6 -Introduce this new patch in the series. drivers/staging/iio/accel/adis16209.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v6 1/6] Staging: iio: adis16209: Indent the field definitions

2018-03-29 Thread Shreeya Patel
Have indentation in field definitions to make them clearly different from the register addresses. Signed-off-by: Shreeya Patel --- Changes in v5 -Change some macro names and have indentation in the field definitions. Changes in v6 -Have indentation in the

[PATCH v6 0/6] adis16209 driver cleanup

2018-03-29 Thread Shreeya Patel
This patchset has been introduced for the cleanup of adis16209 driver. This patchset cleans up miscellaneous code fragments and improves the code readability. After the cleanup, driver is moved from staging to mailine IIO subsystem directory. Changes in v6 -This patchset has some new patches

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

2018-03-29 Thread 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 when allocation is failed. Signed-off-by: Ji-Hun Kim --- Change:

Re: [PATCH 1/1] Drivers: hv: vmbus: Fix ring buffer signaling

2018-03-29 Thread Greg KH
On Wed, Mar 28, 2018 at 12:01:42PM -0700, Stephen Hemminger wrote: > On Sun, 4 Mar 2018 22:24:08 -0700 > k...@exchange.microsoft.com wrote: > > > From: Michael Kelley > > > > Fix bugs in signaling the Hyper-V host when freeing space in the > > host->guest ring buffer: > >

[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

Re: [PATCH 1/9] staging: ks7010: Replace manual array copy with ether_addr_copy().

2018-03-29 Thread Joe Perches
On Wed, 2018-03-28 at 22:51 -0700, Quytelda Kahja wrote: > Copying the dummy HW address into the struct net_device doesn't need > to be done byte by byte; use ether_addr_copy() instead. > Additionally, dev->dev_addr is not eight bytes long. > ether_setup() sets the dev->addr_len to ETH_ALEN

Re: [PATCH 9/9] staging: ks7010: Remove extra blank line between functions.

2018-03-29 Thread Joe Perches
On Wed, 2018-03-28 at 22:51 -0700, Quytelda Kahja wrote: > Remove an extra blank line indicated by checkpatch. The changelog doesn't match the actual changes made. > diff --git a/drivers/staging/ks7010/ks7010_sdio.c > b/drivers/staging/ks7010/ks7010_sdio.c [] > @@ -305,7 +305,8 @@ static void