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

login
register
mail settings
Submitter santosh nayak
Date April 9, 2012, 5:59 a.m.
Message ID <1333951187-4395-1-git-send-email-santoshprasadnayak@gmail.com>
Download mbox | patch
Permalink /patch/151403/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

santosh nayak - April 9, 2012, 5:59 a.m.
From: Santosh Nayak <santoshprasadnayak@gmail.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@gmail.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
David Miller - April 12, 2012, 8:02 p.m.
You haven't told me what tree these two patches should be applied to,
so I am dropping them both.

Resubmit with a proper destination tree indication.

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

Patch

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);