Re: [PATCH v4] NFC: pn533: don't send USB data off of the stack

2018-05-21 Thread Johan Hovold
end van Spriel) > use kmemdup (thanks to Johannes Berg and Julia Lawall) > v2: set the urb flags correctly Your changes look correct now so feel free to add: Reviewed-by: Johan Hovold <jo...@kernel.org> It seems we could end up returning an errno from probe with active urbs (i

Re: [PATCH v3] NFC: pn533: don't send USB data off of the stack

2018-05-18 Thread Johan Hovold
On Fri, May 18, 2018 at 12:38:11PM +0200, Greg Kroah-Hartman wrote: > It's amazing that this driver ever worked, but now that x86 doesn't > allow USB data to be sent off of the stack, it really does not work at > all. Fix this up by properly allocating the data for the small > "commands" that get

[PATCH] net: rfkill: gpio: fix memory leak in probe error path

2018-04-26 Thread Johan Hovold
Make sure to free the rfkill device in case registration fails during probe. Fixes: 5e7ca3937fbe ("net: rfkill: gpio: convert to resource managed allocation") Cc: stable <sta...@vger.kernel.org> # 3.13 Cc: Heikki Krogerus <heikki.kroge...@linux.intel.com> Signed-of

Re: [PATCH] wcn36xx: fix iris child-node lookup

2017-11-13 Thread Johan Hovold
On Mon, Nov 13, 2017 at 08:51:49AM +, Kalle Valo wrote: > Johan Hovold <jo...@kernel.org> writes: > > > Fix child-node lookup during probe, which ended up searching the whole > > device tree depth-first starting at the parent rather than just matching > > on

[PATCH] wcn36xx: fix iris child-node lookup

2017-11-11 Thread Johan Hovold
") Cc: stable <sta...@vger.kernel.org> # 4.14 Cc: Loic Poulain <loic.poul...@linaro.org> Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/net/wireless/ath/wcn36xx/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/w

Re: [PATCH] NFC: fix device-allocation error return

2017-08-28 Thread Johan Hovold
Samuel or David, On Sat, Jul 22, 2017 at 03:32:28PM +0200, Johan Hovold wrote: > On Sun, Jul 09, 2017 at 01:08:58PM +0200, Johan Hovold wrote: > > A recent change fixing NFC device allocation itself introduced an > > error-handling bug by returning an error pointer in

Re: [PATCH] NFC: fix device-allocation error return

2017-07-22 Thread Johan Hovold
On Sun, Jul 09, 2017 at 01:08:58PM +0200, Johan Hovold wrote: > A recent change fixing NFC device allocation itself introduced an > error-handling bug by returning an error pointer in case device-id > allocation failed. This is clearly broken as the callers still expected > NULL to

[PATCH] NFC: fix device-allocation error return

2017-07-09 Thread Johan Hovold
rg> # 3.8 Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Johan Hovold <jo...@kernel.org> --- net/nfc/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/nfc/core.c b/net/nfc/core.c index 5cf33df888c3..c699d64a0753 100644 --- a/net/nfc

Re: [bug report] NFC: fix broken device allocation

2017-07-07 Thread Johan Hovold
On Fri, Jul 07, 2017 at 12:33:34PM +0300, Dan Carpenter wrote: > Hello Johan Hovold, > > The patch 20777bc57c34: "NFC: fix broken device allocation" from Mar > 30, 2017, leads to the following static checker warning: > > drivers/nfc/pn533/pn533.c:2653 pn533_reg

Re: [PATCH v2 0/8] NFC: fix device allocation and nfcmrvl crashes

2017-06-01 Thread Johan Hovold
Hi Samuel, On Tue, May 16, 2017 at 11:42:29AM +0200, Johan Hovold wrote: > On Thu, Apr 27, 2017 at 12:42:38AM +0200, Samuel Ortiz wrote: > > Hi Johan, > > > > On Thu, Mar 30, 2017 at 12:15:34PM +0200, Johan Hovold wrote: > > > This started out with the observatio

Re: [PATCH v2 0/8] NFC: fix device allocation and nfcmrvl crashes

2017-05-16 Thread Johan Hovold
Hi Samuel, On Thu, Apr 27, 2017 at 12:42:38AM +0200, Samuel Ortiz wrote: > Hi Johan, > > On Thu, Mar 30, 2017 at 12:15:34PM +0200, Johan Hovold wrote: > > This started out with the observation that the nfcmrvl_uart driver > > unconditionally dereferenced the tty class de

[PATCH] wireless: mwifiex: add missing USB-descriptor endianness conversion

2017-05-12 Thread Johan Hovold
Add the missing endianness conversions to a debug statement printing the USB device-descriptor bcdUSB field during probe. Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/net/wireless/marvell/mwifiex/usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d

Re: [PATCH v2 0/8] NFC: fix device allocation and nfcmrvl crashes

2017-04-26 Thread Johan Hovold
On Wed, Apr 19, 2017 at 01:24:31AM +0200, Samuel Ortiz wrote: > On Tue, Apr 18, 2017 at 12:09:16PM +0200, Johan Hovold wrote: > > On Thu, Mar 30, 2017 at 12:15:34PM +0200, Johan Hovold wrote: > > > This started out with the observation that the nfcmrvl_uart driver >

Re: [PATCH v2 0/8] NFC: fix device allocation and nfcmrvl crashes

2017-04-18 Thread Johan Hovold
On Thu, Mar 30, 2017 at 12:15:34PM +0200, Johan Hovold wrote: > This started out with the observation that the nfcmrvl_uart driver > unconditionally dereferenced the tty class device despite the fact that > not every tty has an associated struct device (Unix98 ptys). Some > further

Re: [PATCH 1/2] wireless: ath9k_htc: fix NULL-deref at probe

2017-04-03 Thread Johan Hovold
On Mon, Apr 03, 2017 at 01:21:08PM +, Kalle Valo wrote: > Johan Hovold <jo...@kernel.org> writes: > > > On Mon, Apr 03, 2017 at 01:02:28PM +, Kalle Valo wrote: > >> Kalle Valo <kv...@codeaurora.org> writes: > >> > >> > Johan Hovold &l

Re: [PATCH 1/2] wireless: ath9k_htc: fix NULL-deref at probe

2017-04-03 Thread Johan Hovold
On Mon, Apr 03, 2017 at 01:02:28PM +, Kalle Valo wrote: > Kalle Valo <kv...@codeaurora.org> writes: > > > Johan Hovold <jo...@kernel.org> writes: > > > >> On Mon, Mar 13, 2017 at 01:44:20PM +0100, Johan Hovold wrote: > >>> Make sure to c

Re: [PATCH 1/2] wireless: ath9k_htc: fix NULL-deref at probe

2017-04-03 Thread Johan Hovold
On Mon, Mar 13, 2017 at 01:44:20PM +0100, Johan Hovold wrote: > Make sure to check the number of endpoints to avoid dereferencing a > NULL-pointer or accessing memory beyond the endpoint array should a > malicious device lack the expected endpoints. > > Fixes: 36bcce430657 (&qu

[PATCH v2 1/8] NFC: fix broken device allocation

2017-03-30 Thread Johan Hovold
use nfc_free_device() in its error path. Fixes: 7eda8b8e9677 ("NFC: Use IDR library to assing NFC devices IDs") Cc: stable <sta...@vger.kernel.org> # 3.8 Cc: Samuel Ortiz <sa...@linux.intel.com> Signed-off-by: Johan Hovold <jo...@kernel.org> --- net/nfc/core.c

[PATCH v2 0/8] NFC: fix device allocation and nfcmrvl crashes

2017-03-30 Thread Johan Hovold
for different ttys without any actual NFC hardware connected. Johan Changes in v2 - fix typo in commit message (1/8) - release reset gpio in error paths (3/8) - fix description of patch impact (3/8) - allow gpio 0 to be used for reset signalling (8/8, new) Johan Hovold (8): NFC: fix broken device

[PATCH v2 3/8] NFC: nfcmrvl: do not use device-managed resources

2017-03-30 Thread Johan Hovold
valid. This will be addressed in a follow-up patch. Fixes: b2fe288eac72 ("NFC: nfcmrvl: free reset gpio") Fixes: 4a2b947f56b3 ("NFC: nfcmrvl: add chip reset management") Cc: stable <sta...@vger.kernel.org> # 4.2: b2fe288eac72 Cc: Vincent Cuissard <cuiss...@marv

[PATCH v2 2/8] NFC: nfcmrvl_uart: add missing tty-device sanity check

2017-03-30 Thread Johan Hovold
Cuissard <cuiss...@marvell.com> Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/nfc/nfcmrvl/uart.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nfc/nfcmrvl/uart.c b/drivers/nfc/nfcmrvl/uart.c index 83a99e38e7bd..6c0c301611c4 100644 --- a/driv

[PATCH v2 8/8] NFC: nfcmrvl: allow gpio 0 for reset signalling

2017-03-30 Thread Johan Hovold
Allow gpio 0 to be used for reset signalling, and instead use negative errnos to disable the reset functionality. Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/nfc/nfcmrvl/main.c| 9 - include/linux/platform_data/nfcmrvl.h | 2 +- 2 files changed, 5 inse

[PATCH v2 7/8] NFC: nfcmrvl_usb: use interface as phy device

2017-03-30 Thread Johan Hovold
that private device pointer had already been set by nfcmrvl_nci_register_dev() so the redundant assignment can therefore be removed. Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/nfc/nfcmrvl/usb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drive

[PATCH v2 4/8] NFC: nfcmrvl: use nfc-device for firmware download

2017-03-30 Thread Johan Hovold
for any debugging, which is fine for now. Fixes: 3194c6870158 ("NFC: nfcmrvl: add firmware download support") Cc: stable <sta...@vger.kernel.org> # 4.4 Cc: Vincent Cuissard <cuiss...@marvell.com> Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/nfc/nfcmrvl/f

[PATCH v2 5/8] NFC: nfcmrvl: fix firmware-management initialisation

2017-03-30 Thread Johan Hovold
initialisation back to to nci_allocate_device() as the firmware-workqueue name is now derived from the nfc-device name. Fixes: 3194c6870158 ("NFC: nfcmrvl: add firmware download support") Cc: stable <sta...@vger.kernel.org> # 4.4 Cc: Vincent Cuissard <cuiss...@marvell.com> Signe

[PATCH v2 6/8] NFC: nfcmrvl_uart: fix device-node leak during probe

2017-03-30 Thread Johan Hovold
Make sure to release the device-node reference when done parsing the node. Fixes: e097dc624f78 ("NFC: nfcmrvl: add UART driver") Cc: Vincent Cuissard <cuiss...@marvell.com> Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/nfc/nfcmrvl/uart.c | 3 +++ 1 file

Re: [PATCH 3/7] NFC: nfcmrvl: do not use device-managed resources

2017-03-29 Thread Johan Hovold
On Wed, Mar 29, 2017 at 06:21:08PM +0200, Johan Hovold wrote: > This specifically fixes a NULL-pointer dereference when using the n_nci > line discipline on one end of a Unix98 pty as well as resource leaks in > the registration error paths. I noticed I forgot to actually fix up the er

[PATCH 3/7] NFC: nfcmrvl: do not use device-managed resources

2017-03-29 Thread Johan Hovold
the resource leak at close. Fixes: b2fe288eac72 ("NFC: nfcmrvl: free reset gpio") Fixes: 4a2b947f56b3 ("NFC: nfcmrvl: add chip reset management") Cc: stable <sta...@vger.kernel.org> # 4.2: b2fe288eac72 Cc: Vincent Cuissard <cuiss...@marvell.com> Signed-off-by

[PATCH 2/7] NFC: nfcmrvl_uart: add missing tty-device sanity check

2017-03-29 Thread Johan Hovold
Cuissard <cuiss...@marvell.com> Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/nfc/nfcmrvl/uart.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nfc/nfcmrvl/uart.c b/drivers/nfc/nfcmrvl/uart.c index 83a99e38e7bd..6c0c301611c4 100644 --- a/driv

[PATCH 1/7] NFC: fix broken device allocation

2017-03-29 Thread Johan Hovold
use nfc_free_device() in its registration error path. Fixes: 7eda8b8e9677 ("NFC: Use IDR library to assing NFC devices IDs") Cc: stable <sta...@vger.kernel.org> # 3.8 Cc: Samuel Ortiz <sa...@linux.intel.com> Signed-off-by: Johan Hovold <jo

[PATCH 0/7] NFC: fix device allocation and nfcmrvl crashes

2017-03-29 Thread Johan Hovold
for different ttys without any actual NFC hardware connected. Johan Johan Hovold (7): NFC: fix broken device allocation NFC: nfcmrvl_uart: add missing tty-device sanity check NFC: nfcmrvl: do not use device-managed resources NFC: nfcmrvl: use nfc-device for firmware download NFC: nfcmrvl: fix

[PATCH 7/7] NFC: nfcmrvl_usb: use interface as phy device

2017-03-29 Thread Johan Hovold
that private device pointer had already been set by nfcmrvl_nci_register_dev() so the redundant assignment can therefore be removed. Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/nfc/nfcmrvl/usb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drive

[PATCH 4/7] NFC: nfcmrvl: use nfc-device for firmware download

2017-03-29 Thread Johan Hovold
for any debugging, which is fine for now. Fixes: 3194c6870158 ("NFC: nfcmrvl: add firmware download support") Cc: stable <sta...@vger.kernel.org> # 4.4 Cc: Vincent Cuissard <cuiss...@marvell.com> Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/nfc/nfcmrvl/f

[PATCH 6/7] NFC: nfcmrvl_uart: fix device-node leak during probe

2017-03-29 Thread Johan Hovold
Make sure to release the device-node reference when done parsing the node. Fixes: e097dc624f78 ("NFC: nfcmrvl: add UART driver") Cc: Vincent Cuissard <cuiss...@marvell.com> Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/nfc/nfcmrvl/uart.c | 3 +++ 1 file

[PATCH 5/7] NFC: nfcmrvl: fix firmware-management initialisation

2017-03-29 Thread Johan Hovold
initialisation back to to nci_allocate_device() as the firmware-workqueue name is now derived from the nfc-device name. Fixes: 3194c6870158 ("NFC: nfcmrvl: add firmware download support") Cc: stable <sta...@vger.kernel.org> # 4.4 Cc: Vincent Cuissard <cuiss...@marvell.com> Signe

Re: [2/2] zd1211rw: fix NULL-deref at probe

2017-03-22 Thread Johan Hovold
On Wed, Mar 22, 2017 at 03:02:12PM +0200, Kalle Valo wrote: > Johan Hovold <jo...@kernel.org> writes: > > > On Wed, Mar 22, 2017 at 09:04:15AM +, Kalle Valo wrote: > >> Johan Hovold <jo...@kernel.org> wrote: > >> > Make sure to check t

Re: [2/2] zd1211rw: fix NULL-deref at probe

2017-03-22 Thread Johan Hovold
On Wed, Mar 22, 2017 at 09:04:15AM +, Kalle Valo wrote: > Johan Hovold <jo...@kernel.org> wrote: > > Make sure to check the number of endpoints to avoid dereferencing a > > NULL-pointer or accessing memory beyond the endpoint array should a > > malicious device

[PATCH 1/2] wireless: ath9k_htc: fix NULL-deref at probe

2017-03-13 Thread Johan Hovold
.@atheros.com> Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/net/wireless/ath/ath9k/hif_usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index de2d212f39ec..9206955e865a 100644 --- a/dr

[PATCH 2/2] wireless: zd1211rw: fix NULL-deref at probe

2017-03-13 Thread Johan Hovold
l Drake <d...@gentoo.org> Signed-off-by: Johan Hovold <jo...@kernel.org> --- drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c index c5effd6c6be

Re: [PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-14 Thread Johan Hovold
On Wed, Dec 09, 2015 at 03:46:00PM +0100, Linus Walleij wrote: > On Wed, Dec 9, 2015 at 2:44 PM, Russell King - ARM Linux > wrote: > > On Wed, Dec 09, 2015 at 02:08:35PM +0100, Linus Walleij wrote: > >> Because we want to have a proper userspace ABI for GPIO chips, > >>