s390/qeth: fix race when initializing the IP address table
authorJulian Wiedmann <jwi@linux.ibm.com>
Mon, 18 Mar 2019 15:40:55 +0000 (16:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Mar 2019 01:34:45 +0000 (18:34 -0700)
The ucast IP table is utilized by some of the L3-specific sysfs attributes
that qeth_l3_create_device_attributes() provides. So initialize the table
_before_ registering the attributes.

Fixes: ebccc7397e4a ("s390/qeth: add missing hash table initializations")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_l3_main.c

index 2f002843b16eb8a24c7d441ddff6915d074645fb..d805e72edb58e6ef88356e23b9c3bf047ca49cdc 100644 (file)
@@ -2253,12 +2253,14 @@ static int qeth_l3_probe_device(struct ccwgroup_device *gdev)
        struct qeth_card *card = dev_get_drvdata(&gdev->dev);
        int rc;
 
+       hash_init(card->ip_htable);
+
        if (gdev->dev.type == &qeth_generic_devtype) {
                rc = qeth_l3_create_device_attributes(&gdev->dev);
                if (rc)
                        return rc;
        }
-       hash_init(card->ip_htable);
+
        hash_init(card->ip_mc_htable);
        return 0;
 }