Commit 6a957193 authored by Tim Sell's avatar Tim Sell Committed by Greg Kroah-Hartman

staging: unisys: visornic: convert BUG_ON to dev_err() message

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: default avatarTim Sell <Timothy.Sell@unisys.com>
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 853adce6
...@@ -209,7 +209,7 @@ static void poll_for_irq(unsigned long v); ...@@ -209,7 +209,7 @@ static void poll_for_irq(unsigned long v);
* Return value indicates number of entries filled in frags * Return value indicates number of entries filled in frags
* Negative values indicate an error. * Negative values indicate an error.
*/ */
static unsigned int static int
visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen, visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen,
unsigned int frags_max, unsigned int frags_max,
struct phys_info frags[]) struct phys_info frags[])
...@@ -269,11 +269,9 @@ visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen, ...@@ -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 * zero if the frags array is out of room
* That should never happen because we * That should never happen because we
* fail above, if count+numfrags > frags_max. * 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) { if (skb_shinfo(skb)->frag_list) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment