* [PATCH v2 0/1] staging: unisys: convert BUG_ON to dev_err() message
@ 2016-04-13 15:56 David Kershner
2016-04-13 15:56 ` [PATCH v2 1/1] staging: unisys: visornic: " David Kershner
0 siblings, 1 reply; 2+ messages in thread
From: David Kershner @ 2016-04-13 15:56 UTC (permalink / raw)
To: gregkh, driverdev-devel, sparmaintainer
This is the resend of the patch covert BUG_ON to dev_err() message.
changes since v1:
- Updated patch to return an actual error instead of -1
Tim Sell (1):
staging: unisys: visornic: convert BUG_ON to dev_err() message
drivers/staging/unisys/visornic/visornic_main.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--
1.9.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2 1/1] staging: unisys: visornic: convert BUG_ON to dev_err() message
2016-04-13 15:56 [PATCH v2 0/1] staging: unisys: convert BUG_ON to dev_err() message David Kershner
@ 2016-04-13 15:56 ` David Kershner
0 siblings, 0 replies; 2+ messages in thread
From: David Kershner @ 2016-04-13 15:56 UTC (permalink / raw)
To: gregkh, driverdev-devel, sparmaintainer; +Cc: Tim Sell
From: Tim Sell <Timothy.Sell@unisys.com>
The caller of visor_copy_fragsinfo_from_skb() is prepared to log a
dev_err() message if it fails (by returning a negative value), so we now
just fail in the one occasion where visor_copy_fragsinfo_from_skb() was
doing a BUG_ON.
There was also a problem before where visor_copy_fragsinfo_from_skb() was
returning a negative to indicate error, yet it was declared to return an
unsigned value! So obviously that needed correcting too.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
---
drivers/staging/unisys/visornic/visornic_main.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c
index 0ec952a..de983d2 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -209,7 +209,7 @@ static void poll_for_irq(unsigned long v);
* Return value indicates number of entries filled in frags
* Negative values indicate an error.
*/
-static unsigned int
+static int
visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen,
unsigned int frags_max,
struct phys_info frags[])
@@ -269,11 +269,9 @@ visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen,
* zero if the frags array is out of room
* That should never happen because we
* fail above, if count+numfrags > frags_max.
- * Given that theres no recovery mechanism from putting
- * half a packet in the I/O channel, panic here as this
- * should never happen
*/
- BUG_ON(!count);
+ if (!count)
+ return -EINVAL;
}
}
if (skb_shinfo(skb)->frag_list) {
--
1.9.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-13 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-13 15:56 [PATCH v2 0/1] staging: unisys: convert BUG_ON to dev_err() message David Kershner
2016-04-13 15:56 ` [PATCH v2 1/1] staging: unisys: visornic: " David Kershner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.