Skip to content

Commit 857d8ee

Browse files
julianwiedmanndavem330
authored andcommitted
s390/qeth: don't verify device when setting MAC address
There's no reason why l2_set_mac_address() should ever be called for a netdevice that's not owned by qeth. It's certainly not required for VLAN devices, which have their own netdev_ops. Also: 1) we don't do such validation for any of the other netdev_ops routines. 2) the code in question clearly has never been actually exercised; it's broken. After determining that the device is not owned by qeth, it would still use dev->ml_priv to write a qeth trace entry. Remove the check, and its helper that walked the global card list. Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6e6f472 commit 857d8ee

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

drivers/s390/net/qeth_l2_main.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,6 @@ static void qeth_l2_vnicc_init(struct qeth_card *card);
3838
static bool qeth_l2_vnicc_recover_timeout(struct qeth_card *card, u32 vnicc,
3939
u32 *timeout);
4040

41-
static int qeth_l2_verify_dev(struct net_device *dev)
42-
{
43-
struct qeth_card *card;
44-
unsigned long flags;
45-
int rc = 0;
46-
47-
read_lock_irqsave(&qeth_core_card_list.rwlock, flags);
48-
list_for_each_entry(card, &qeth_core_card_list.list, list) {
49-
if (card->dev == dev) {
50-
rc = QETH_REAL_CARD;
51-
break;
52-
}
53-
}
54-
read_unlock_irqrestore(&qeth_core_card_list.rwlock, flags);
55-
56-
return rc;
57-
}
58-
5941
static struct net_device *qeth_l2_netdev_by_devno(unsigned char *read_dev_no)
6042
{
6143
struct qeth_card *card;
@@ -568,11 +550,6 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
568550

569551
QETH_CARD_TEXT(card, 3, "setmac");
570552

571-
if (qeth_l2_verify_dev(dev) != QETH_REAL_CARD) {
572-
QETH_CARD_TEXT(card, 3, "setmcINV");
573-
return -EOPNOTSUPP;
574-
}
575-
576553
if (card->info.type == QETH_CARD_TYPE_OSN ||
577554
card->info.type == QETH_CARD_TYPE_OSM ||
578555
card->info.type == QETH_CARD_TYPE_OSX) {

0 commit comments

Comments
 (0)