From: Dan Carpenter <error27@gmail.com>
To: Jeff Chen <jeff.chen_1@nxp.com>
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] wifi: nxp: add nxpwifi driver for IW61x
Date: Wed, 12 Aug 2026 11:19:17 +0300 [thread overview]
Message-ID: <anwshVbQWXXHTJpa@stanley.mountain> (raw)
Hello Jeff Chen,
Commit 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x") from
Jun 5, 2026 (linux-next), leads to the following Smatch static
checker warning:
drivers/net/wireless/nxp/nxpwifi/main.c:627 _nxpwifi_fw_dpc()
warn: missing error code here? 'IS_ERR()' failed. 'ret' = '0'
drivers/net/wireless/nxp/nxpwifi/main.c
552 static int _nxpwifi_fw_dpc(const struct firmware *firmware, void *context)
553 {
554 int ret = 0;
555 char fmt[64];
556 struct nxpwifi_adapter *adapter = context;
557 struct nxpwifi_fw_image fw;
558 bool init_failed = false;
559 struct wireless_dev *wdev;
560 struct completion *fw_done = adapter->fw_done;
561
562 if (!firmware) {
563 nxpwifi_dbg(adapter, ERROR,
564 "Failed to get firmware %s\n", adapter->fw_name);
565 ret = -EINVAL;
566 goto err_dnld_fw;
567 }
568
569 memset(&fw, 0, sizeof(struct nxpwifi_fw_image));
570 adapter->firmware = firmware;
571 fw.fw_buf = (u8 *)adapter->firmware->data;
572 fw.fw_len = adapter->firmware->size;
573
574 if (adapter->if_ops.dnld_fw)
575 ret = adapter->if_ops.dnld_fw(adapter, &fw);
576 else
577 ret = nxpwifi_dnld_fw(adapter, &fw);
578
579 if (ret)
580 goto err_dnld_fw;
581
582 nxpwifi_dbg(adapter, MSG, "WLAN FW is active\n");
583
584 /* Load optional calibration data */
585 ret = request_firmware(&adapter->cal_data, cal_data_name, adapter->dev);
586 if (ret) {
587 nxpwifi_dbg(adapter, INFO, "no %s, using default cal\n",
588 cal_data_name);
589 adapter->cal_data = NULL;
590 }
591
592 /* enable host interrupt after fw dnld is successful */
593 if (adapter->if_ops.enable_int) {
594 ret = adapter->if_ops.enable_int(adapter);
595 if (ret)
596 goto err_dnld_fw;
597 }
598
599 ret = nxpwifi_init_fw(adapter);
600 if (ret)
601 goto err_init_fw;
602
603 maybe_quirk_fw_disable_ds(adapter);
604
605 if (!adapter->wiphy) {
606 if (nxpwifi_register_cfg80211(adapter)) {
607 nxpwifi_dbg(adapter, ERROR,
608 "cannot register with cfg80211\n");
609 goto err_init_fw;
error code not set.
610 }
611 }
612
613 if (nxpwifi_init_channel_scan_gap(adapter)) {
614 nxpwifi_dbg(adapter, ERROR,
615 "could not init channel stats table\n");
616 goto err_init_chan_scan;
not set.
617 }
618
619 rtnl_lock();
620 /* Create station interface by default */
621 wdev = nxpwifi_add_virtual_intf(adapter->wiphy, "mlan%d", NET_NAME_ENUM,
622 NL80211_IFTYPE_STATION, NULL);
623 if (IS_ERR(wdev)) {
624 nxpwifi_dbg(adapter, ERROR,
625 "cannot create default STA interface\n");
626 rtnl_unlock();
--> 627 goto err_add_intf;
not set.
628 }
629
630 wdev = nxpwifi_add_virtual_intf(adapter->wiphy, "uap%d", NET_NAME_ENUM,
631 NL80211_IFTYPE_AP, NULL);
632 if (IS_ERR(wdev)) {
633 nxpwifi_dbg(adapter, ERROR,
634 "cannot create AP interface\n");
635 rtnl_unlock();
636 goto err_add_intf;
error code not set.
637 }
638
639 rtnl_unlock();
640
641 nxpwifi_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1);
642 nxpwifi_dbg(adapter, MSG, "driver_version = %s\n", fmt);
643 adapter->is_up = true;
644 goto done;
645
646 err_add_intf:
647 vfree(adapter->chan_stats);
648 err_init_chan_scan:
649 wiphy_unregister(adapter->wiphy);
650 wiphy_free(adapter->wiphy);
651 err_init_fw:
652 if (adapter->if_ops.disable_int)
653 adapter->if_ops.disable_int(adapter);
654 err_dnld_fw:
655 nxpwifi_dbg(adapter, ERROR,
656 "info: %s: unregister device\n", __func__);
657 if (adapter->if_ops.unregister_dev)
658 adapter->if_ops.unregister_dev(adapter);
659
660 set_bit(NXPWIFI_SURPRISE_REMOVED, &adapter->work_flags);
661 nxpwifi_terminate_workqueue(adapter);
662
663 if (adapter->hw_status == NXPWIFI_HW_STATUS_READY) {
664 pr_debug("info: %s: shutdown nxpwifi\n", __func__);
665 nxpwifi_shutdown_drv(adapter);
666 nxpwifi_free_cmd_buffers(adapter);
667 }
668
669 init_failed = true;
670 done:
671 if (adapter->cal_data) {
672 release_firmware(adapter->cal_data);
673 adapter->cal_data = NULL;
674 }
675 if (adapter->firmware) {
676 release_firmware(adapter->firmware);
677 adapter->firmware = NULL;
678 }
679 if (init_failed)
680 nxpwifi_free_adapter(adapter);
681
682 /* Tell all current and future waiters we're finished */
683 complete_all(fw_done);
684
685 return ret;
686 }
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
next reply other threads:[~2026-08-12 8:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 8:19 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-08-12 8:11 [bug report] wifi: nxp: add nxpwifi driver for IW61x Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=anwshVbQWXXHTJpa@stanley.mountain \
--to=error27@gmail.com \
--cc=jeff.chen_1@nxp.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox