[PATCH 1/2] qlcnic: Add default swtich case in 'qlcnic_can_start_firmware()'

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

 



From: Santosh Nayak <santoshprasadnayak@xxxxxxxxx>

QLCRD32() may return bad state.
Its good to have default switch case:
	1. to avoid unexpected system behaviour.
	2. to avoid extra computation thats happening
	   after switch case.

Signed-off-by: Santosh Nayak <santoshprasadnayak@xxxxxxxxx>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 75c32e8..d30b9b8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2787,6 +2787,11 @@ qlcnic_can_start_firmware(struct qlcnic_adapter *adapter)
 	case QLCNIC_DEV_INITIALIZING:
 	case QLCNIC_DEV_QUISCENT:
 		break;
+
+	default:
+		dev_err(&adapter->pdev->dev, "Invalid state\n");
+		qlcnic_api_unlock(adapter);
+		return -EINVAL;
 	}
 
 	qlcnic_api_unlock(adapter);
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux