summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorNeil Horman <nhorman@redhat.com>2015-07-21 09:55:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-22 21:19:17 -0700
commit998ff7f85d2a4923cf8e49319957bb2a70f8b881 (patch)
treea24626722449bb0d0ac07170d9fd77a9661ee4bc /drivers/staging
parentce657aa81005ddfbdd9c89ec9de31ff713c05ea6 (diff)
staging: unisys: BUG halt on error in I/O channel
We precheck that we have enough space in an iochannel prior to writing to it when we send in a fragmented skb. Given that there is no recovery from this condition that I can see, turn it into a BUG halt Signed-off-by: Neil Horman <nhorman@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/unisys/visornic/visornic_main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c
index 1a0efe25f929..f7363925f4a1 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -254,8 +254,16 @@ visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen,
page_offset,
skb_shinfo(skb)->frags[ii].
size, count, frags_max, frags);
- if (!count)
- return -EIO;
+ /*
+ * add_physinfo_entries only returns
+ * 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 (skb_shinfo(skb)->frag_list) {