Re: [PATCH 3/3] nvme-core: fix crash when nvme_enable_aen timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 74f76aa78b02..f4c347fe925a 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1422,21 +1422,25 @@ EXPORT_SYMBOL_GPL(nvme_set_queue_count);
  	(NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT | \
  	 NVME_AEN_CFG_ANA_CHANGE | NVME_AEN_CFG_DISC_CHANGE)
-static void nvme_enable_aen(struct nvme_ctrl *ctrl)
+static int nvme_enable_aen(struct nvme_ctrl *ctrl)
  {
  	u32 result, supported_aens = ctrl->oaes & NVME_AEN_SUPPORTED;
  	int status;
if (!supported_aens)
-		return;
+		return 0;
status = nvme_set_features(ctrl, NVME_FEAT_ASYNC_EVENT, supported_aens,
  			NULL, 0, &result);
-	if (status)
+	if (status) {
  		dev_warn(ctrl->device, "Failed to configure AEN (cfg %x)\n",
  			 supported_aens);
+		if (status < 0)
+			return status;

Why do you need to check status < 0, you need to fail it regardless.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux