Skip to content

Commit 6b4d24d

Browse files
committed
Merge branch 'qeth-fixes'
Julian Wiedmann says: ==================== s390/qeth: fixes 2018-09-12 please apply the following qeth fixes for -net. Patch 1 resolves a regression in an error path, while patch 2 enables the SG support by default that was newly introduced with 4.19. Patch 3 takes care of a longstanding problem with large-order allocations, and patch 4 fixes a potential out-of-bounds access. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents cc4dfb7 + 0ac1487 commit 6b4d24d

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

drivers/s390/net/qeth_core_main.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/netdevice.h>
2626
#include <linux/netdev_features.h>
2727
#include <linux/skbuff.h>
28+
#include <linux/vmalloc.h>
2829

2930
#include <net/iucv/af_iucv.h>
3031
#include <net/dsfield.h>
@@ -4699,7 +4700,7 @@ static int qeth_query_oat_command(struct qeth_card *card, char __user *udata)
46994700

47004701
priv.buffer_len = oat_data.buffer_len;
47014702
priv.response_len = 0;
4702-
priv.buffer = kzalloc(oat_data.buffer_len, GFP_KERNEL);
4703+
priv.buffer = vzalloc(oat_data.buffer_len);
47034704
if (!priv.buffer) {
47044705
rc = -ENOMEM;
47054706
goto out;
@@ -4740,7 +4741,7 @@ static int qeth_query_oat_command(struct qeth_card *card, char __user *udata)
47404741
rc = -EFAULT;
47414742

47424743
out_free:
4743-
kfree(priv.buffer);
4744+
vfree(priv.buffer);
47444745
out:
47454746
return rc;
47464747
}
@@ -5706,6 +5707,8 @@ static struct net_device *qeth_alloc_netdev(struct qeth_card *card)
57065707
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
57075708
dev->hw_features |= NETIF_F_SG;
57085709
dev->vlan_features |= NETIF_F_SG;
5710+
if (IS_IQD(card))
5711+
dev->features |= NETIF_F_SG;
57095712
}
57105713

57115714
return dev;
@@ -5768,8 +5771,10 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
57685771
qeth_update_from_chp_desc(card);
57695772

57705773
card->dev = qeth_alloc_netdev(card);
5771-
if (!card->dev)
5774+
if (!card->dev) {
5775+
rc = -ENOMEM;
57725776
goto err_card;
5777+
}
57735778

57745779
qeth_determine_capabilities(card);
57755780
enforced_disc = qeth_enforce_discipline(card);

drivers/s390/net/qeth_l2_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card,
423423
default:
424424
dev_kfree_skb_any(skb);
425425
QETH_CARD_TEXT(card, 3, "inbunkno");
426-
QETH_DBF_HEX(CTRL, 3, hdr, QETH_DBF_CTRL_LEN);
426+
QETH_DBF_HEX(CTRL, 3, hdr, sizeof(*hdr));
427427
continue;
428428
}
429429
work_done++;

drivers/s390/net/qeth_l3_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
13901390
default:
13911391
dev_kfree_skb_any(skb);
13921392
QETH_CARD_TEXT(card, 3, "inbunkno");
1393-
QETH_DBF_HEX(CTRL, 3, hdr, QETH_DBF_CTRL_LEN);
1393+
QETH_DBF_HEX(CTRL, 3, hdr, sizeof(*hdr));
13941394
continue;
13951395
}
13961396
work_done++;

0 commit comments

Comments
 (0)