netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: santosh nayak <santoshprasadnayak@gmail.com>
To: anirban.chakraborty@qlogic.com, rajesh.borundia@qlogic.com
Cc: sony.chacko@qlogic.com, linux-driver@qlogic.com,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Santosh Nayak <santoshprasadnayak@gmail.com>
Subject: [PATCH 1/2] qlcnic: Add default swtich case in 'qlcnic_can_start_firmware()'
Date: Mon,  9 Apr 2012 11:29:47 +0530	[thread overview]
Message-ID: <1333951187-4395-1-git-send-email-santoshprasadnayak@gmail.com> (raw)

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

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

             reply	other threads:[~2012-04-09  6:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09  5:59 santosh nayak [this message]
2012-04-12 20:02 ` [PATCH 1/2] qlcnic: Add default swtich case in 'qlcnic_can_start_firmware()' David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333951187-4395-1-git-send-email-santoshprasadnayak@gmail.com \
    --to=santoshprasadnayak@gmail.com \
    --cc=anirban.chakraborty@qlogic.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-driver@qlogic.com \
    --cc=netdev@vger.kernel.org \
    --cc=rajesh.borundia@qlogic.com \
    --cc=sony.chacko@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).