* [bug report] mt76: mt7915: fix possible deadlock in mt7915_stop
@ 2020-05-20 12:09 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-05-20 12:09 UTC (permalink / raw)
To: ryder.lee; +Cc: Ryder Lee, linux-wireless, linux-mediatek
Hello Ryder Lee,
The patch 57b9df6fa5f5: "mt76: mt7915: fix possible deadlock in
mt7915_stop" from May 12, 2020, leads to the following static checker
warning:
drivers/net/wireless/mediatek/mt76/mt7915/init.c:595 mt7915_register_ext_phy()
error: we previously assumed 'phy' could be null (see line 592)
drivers/net/wireless/mediatek/mt76/mt7615/init.c:371 mt7615_register_ext_phy()
error: we previously assumed 'phy' could be null (see line 368)
drivers/net/wireless/mediatek/mt76/mt7915/init.c
589 if (test_bit(MT76_STATE_RUNNING, &dev->mphy.state))
590 return -EINVAL;
591
592 if (phy)
^^^
593 return 0;
594
595 INIT_DELAYED_WORK(&phy->mac_work, mt7915_mac_work);
^^^^^^^^^^^^^^
This will Oops.
596 mt7915_cap_dbdc_enable(dev);
597 mphy = mt76_alloc_phy(&dev->mt76, sizeof(*phy), &mt7915_ops);
598 if (!mphy)
599 return -ENOMEM;
600
601 phy = mphy->priv;
^^^^^^^^^^^^^^^^
phy is set here again.
602 phy->dev = dev;
603 phy->mt76 = mphy;
604 phy->chainmask = dev->chainmask & ~dev->phy.chainmask;
605 mphy->antenna_mask = BIT(hweight8(phy->chainmask)) - 1;
606 mt7915_init_wiphy(mphy->hw);
See also:
drivers/net/wireless/mediatek/mt76/mt7615/init.c:371 mt7615_register_ext_phy() error: we previously assumed 'phy' could be null (see line 368)
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-20 12:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-20 12:09 [bug report] mt76: mt7915: fix possible deadlock in mt7915_stop Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).