Skip to contentSkip to conversation

gnss: fixes for char-misc-next

PATCH In review Johan Hovold 2 participants 5 messages Jul 16, 2018 Gnss

lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

cover gnss: fixes for char-misc-next

Hi Greg,

Here's a resend of two gnss fixes for char-misc-next which I noted you haven't picked up directly (I'll continue picking these up an forwarding to you in batches if that's alright).

Thanks,
Johan

Colin Ian King (1):
gnss: ubx: make struct ubx_gserial_ops static

Dan Carpenter (1):
gnss: fix potential error pointer dereference

 drivers/gnss/core.c | 4 ++--
 drivers/gnss/ubx.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.18.0
author maintainer
#1 lore raw

PATCH 1/2 gnss: ubx: make struct ubx_gserial_ops static

From: Colin Ian King <[email protected]>

The structure ubx_gserial_ops is local to the source and does not need to be in global scope, so make it static.

Cleans up sparse warning:
symbol 'ubx_gserial_ops' was not declared. Should it be static?

---
 drivers/gnss/ubx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gnss/ubx.c +1 -1
index 902b6854b7db..12568aebb7f6 100644
@@ -59,7 +59,7 @@ static int ubx_set_power(struct gnss_serial *gserial,
 	return -EINVAL;
 }
 
-const struct gnss_serial_ops ubx_gserial_ops = {
+static const struct gnss_serial_ops ubx_gserial_ops = {
 	.set_power = ubx_set_power,
 };
 
Signature · 1 line
2.18.0
author maintainer
#2 lore raw

PATCH 2/2 gnss: fix potential error pointer dereference

In reply to Johan Hovold

From: Dan Carpenter <[email protected]>

The gnss_allocate_device() function returns a mix of NULL and error pointers on error. It should only return one or the other. Since the callers both check for NULL, I've modified it to return NULL on error.

Fixes 2b6a44035143 ("gnss: add GNSS receiver subsystem")
---
 drivers/gnss/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gnss/core.c +2 -2
index f30ef8338b3a..4291a0dd22aa 100644
@@ -235,7 +235,7 @@ struct gnss_device *gnss_allocate_device(struct device *parent)
 	id = ida_simple_get(&gnss_minors, 0, GNSS_MINORS, GFP_KERNEL);
 	if (id < 0) {
 		kfree(gdev);
-		return ERR_PTR(id);
+		return NULL;
 	}
 
 	gdev->id = id;
@@ -270,7 +270,7 @@ struct gnss_device *gnss_allocate_device(struct device *parent)
 err_put_device:
 	put_device(dev);
 
-	return ERR_PTR(-ENOMEM);
+	return NULL;
 }
 EXPORT_SYMBOL_GPL(gnss_allocate_device);
 
Signature · 1 line
2.18.0
#3 lore raw
In reply to Johan Hovold
Quoted 5 lines · Johan Hovold

Hi Greg,

Here's a resend of two gnss fixes for char-misc-next which I noted you haven't picked up directly (I'll continue picking these up an forwarding to you in batches if that's alright).

That's fine, I didn't see them myself, which is why I didn't pick them up. I'll just wait for you to forward patches on for this subsystem, as that makes things a lot easier for me.

thanks,

greg k-h

author maintainer
#4 lore raw
Quoted 10 lines · Greg Kroah-Hartman
Quoted 5 lines · Johan Hovold

Hi Greg,

Here's a resend of two gnss fixes for char-misc-next which I noted you haven't picked up directly (I'll continue picking these up an forwarding to you in batches if that's alright).

That's fine, I didn't see them myself, which is why I didn't pick them up. I'll just wait for you to forward patches on for this subsystem, as that makes things a lot easier for me.

Perfect, thanks!

Johan