Skip to content

Commit

Permalink
s390/qeth: fix race when initializing the IP address table
Browse files Browse the repository at this point in the history
[ Upstream commit 7221b727f0079a32aca91f657141e1de564d4b97 ]

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: ebccc73 ("s390/qeth: add missing hash table initializations")
Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin (Microsoft) <[email protected]>
  • Loading branch information
julianwiedmann authored and gregkh committed May 4, 2019
1 parent e634fc4 commit f670211
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/s390/net/qeth_l3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2586,12 +2586,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);
card->options.layer2 = 0;
card->info.hwtrap = 0;
Expand Down

0 comments on commit f670211

Please sign in to comment.