summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2018-01-08 18:11:15 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2018-01-17 00:54:51 -0500
commitdbc1ebe7b0fd43f7d74ba0e87b411eb48c9fdeb2 (patch)
tree0f608da2ebffd78705ebccc69d388a2de5300571
parent87058dded5df91f5e61aa2c80edb06daa41ed6dc (diff)
scsi: fnic: use kzalloc in fnic_fcoe_process_vlan_resp
This saves a little .text and gets rid of the unmotivated line break and the sizeof(...) style inconsistency. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/fnic/fnic_fcs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
index 999fc7547560..c7bf316d8e83 100644
--- a/drivers/scsi/fnic/fnic_fcs.c
+++ b/drivers/scsi/fnic/fnic_fcs.c
@@ -442,15 +442,13 @@ static void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct sk_buff *skb)
442 vid = ntohs(((struct fip_vlan_desc *)desc)->fd_vlan); 442 vid = ntohs(((struct fip_vlan_desc *)desc)->fd_vlan);
443 shost_printk(KERN_INFO, fnic->lport->host, 443 shost_printk(KERN_INFO, fnic->lport->host,
444 "process_vlan_resp: FIP VLAN %d\n", vid); 444 "process_vlan_resp: FIP VLAN %d\n", vid);
445 vlan = kmalloc(sizeof(*vlan), 445 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC);
446 GFP_ATOMIC);
447 if (!vlan) { 446 if (!vlan) {
448 /* retry from timer */ 447 /* retry from timer */
449 spin_unlock_irqrestore(&fnic->vlans_lock, 448 spin_unlock_irqrestore(&fnic->vlans_lock,
450 flags); 449 flags);
451 goto out; 450 goto out;
452 } 451 }
453 memset(vlan, 0, sizeof(struct fcoe_vlan));
454 vlan->vid = vid & 0x0fff; 452 vlan->vid = vid & 0x0fff;
455 vlan->state = FIP_VLAN_AVAIL; 453 vlan->state = FIP_VLAN_AVAIL;
456 list_add_tail(&vlan->list, &fnic->vlans); 454 list_add_tail(&vlan->list, &fnic->vlans);