diff options
author | Hiral Patel <hiralpat@cisco.com> | 2013-02-25 19:18:37 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-02 10:32:23 -0400 |
commit | d7fadce335fa4d38868f331c9265b139e797986f (patch) | |
tree | e5364789597ff17300cb7f3f41e4bdde353eaa0a | |
parent | d3c995f1dcf938f1084388d92b8fb97bec366566 (diff) |
[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.c | 6 |
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) | |||
603 | skb_reset_mac_header(skb); | 603 | skb_reset_mac_header(skb); |
604 | } | 604 | } |
605 | if (eh->h_proto == htons(ETH_P_FIP)) { | 605 | if (eh->h_proto == htons(ETH_P_FIP)) { |
606 | if (!(fnic->config.flags & VFCF_FIP_CAPABLE)) { | ||
607 | printk(KERN_ERR "Dropped FIP frame, as firmware " | ||
608 | "uses non-FIP mode, Enable FIP " | ||
609 | "using UCSM\n"); | ||
610 | goto drop; | ||
611 | } | ||
606 | skb_queue_tail(&fnic->fip_frame_queue, skb); | 612 | skb_queue_tail(&fnic->fip_frame_queue, skb); |
607 | queue_work(fnic_fip_queue, &fnic->fip_frame_work); | 613 | queue_work(fnic_fip_queue, &fnic->fip_frame_work); |
608 | return 1; /* let caller know packet was used */ | 614 | return 1; /* let caller know packet was used */ |