Skip to contentSkip to conversation

nvme-apple: Destroy the admin queue on removal

bug report Dan Carpenter 1 participant 1 message Sep 14 NVMe

lore
Share & tools
lore
#0 lore raw

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