lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1333951187-4395-1-git-send-email-santoshprasadnayak@gmail.com>
Date:	Mon,  9 Apr 2012 11:29:47 +0530
From:	santosh nayak <santoshprasadnayak@...il.com>
To:	anirban.chakraborty@...gic.com, rajesh.borundia@...gic.com
Cc:	sony.chacko@...gic.com, linux-driver@...gic.com,
	netdev@...r.kernel.org, kernel-janitors@...r.kernel.org,
	Santosh Nayak <santoshprasadnayak@...il.com>
Subject: [PATCH 1/2] qlcnic: Add default swtich case in 'qlcnic_can_start_firmware()'

From: Santosh Nayak <santoshprasadnayak@...il.com>

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@...il.com>
---
 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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ