summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiral Patel <hiralpat@cisco.com>2013-02-25 16:18:37 -0800
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 07:32:23 -0700
commitd7fadce335fa4d38868f331c9265b139e797986f (patch)
treee5364789597ff17300cb7f3f41e4bdde353eaa0a
parentd3c995f1dcf938f1084388d92b8fb97bec366566 (diff)
downloadlinux-stable-d7fadce335fa4d38868f331c9265b139e797986f.tar.gz
linux-stable-d7fadce335fa4d38868f331c9265b139e797986f.tar.bz2
linux-stable-d7fadce335fa4d38868f331c9265b139e797986f.zip
[SCSI] fnic: Kernel panic due to FIP mode misconfiguration
If switch configured in FIP and adapter configured in non-fip mode, driver panics while queueing FIP frame in non-existing fip_frame_queue. Added config check before queueing FIP frame in misconfiguration case to avoid kernel panic. Signed-off-by: Hiral Patel <hiralpat@cisco.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/fnic/fnic_fcs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
index 34a0b7ddb688..006fa92a02df 100644
--- a/drivers/scsi/fnic/fnic_fcs.c
+++ b/drivers/scsi/fnic/fnic_fcs.c
@@ -603,6 +603,12 @@ static inline int fnic_import_rq_eth_pkt(struct fnic *fnic, struct sk_buff *skb)
skb_reset_mac_header(skb);
}
if (eh->h_proto == htons(ETH_P_FIP)) {
+ if (!(fnic->config.flags & VFCF_FIP_CAPABLE)) {
+ printk(KERN_ERR "Dropped FIP frame, as firmware "
+ "uses non-FIP mode, Enable FIP "
+ "using UCSM\n");
+ goto drop;
+ }
skb_queue_tail(&fnic->fip_frame_queue, skb);
queue_work(fnic_fip_queue, &fnic->fip_frame_work);
return 1; /* let caller know packet was used */