[bug report] nvme-apple: Destroy the admin queue on removal

Dan Carpenter error27 at gmail.com
Mon Sep 14 03:34:46 PDT 2026


Hello Sven Peter,

Commit 87d5b9864c81 ("nvme-apple: Destroy the admin queue on
removal") from Aug 6, 2026, leads to the following Smatch complaint:

    drivers/nvme/host/apple.c:1642 apple_nvme_remove()
    warn: variable dereferenced before check 'anv->ctrl.admin_q' (see line 1641)

drivers/nvme/host/apple.c
  1640		nvme_remove_namespaces(&anv->ctrl);
  1641		apple_nvme_disable(anv, true);
                                   ^^^
This dereferences anv->ctrl.admin_q

  1642		if (anv->ctrl.admin_q && !blk_queue_dying(anv->ctrl.admin_q)) {
                    ^^^^^^^^^^^^^^^^^
So this NULL check is pointless and can be removed.

  1643			/*
  1644			 * If the controller was reset during removal, it's possible

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter



More information about the Linux-nvme mailing list