]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: fnic: use kzalloc in fnic_fcoe_process_vlan_resp
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Mon, 8 Jan 2018 23:11:15 +0000 (00:11 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 17 Jan 2018 05:54:51 +0000 (00:54 -0500)
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>
drivers/scsi/fnic/fnic_fcs.c

index 999fc7547560003fe73a9f870d1ba986a70095b8..c7bf316d8e83447a33e139ba846ea254dbc42f91 100644 (file)
@@ -442,15 +442,13 @@ static void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct sk_buff *skb)
                        vid = ntohs(((struct fip_vlan_desc *)desc)->fd_vlan);
                        shost_printk(KERN_INFO, fnic->lport->host,
                                  "process_vlan_resp: FIP VLAN %d\n", vid);
-                       vlan = kmalloc(sizeof(*vlan),
-                                                       GFP_ATOMIC);
+                       vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC);
                        if (!vlan) {
                                /* retry from timer */
                                spin_unlock_irqrestore(&fnic->vlans_lock,
                                                        flags);
                                goto out;
                        }
-                       memset(vlan, 0, sizeof(struct fcoe_vlan));
                        vlan->vid = vid & 0x0fff;
                        vlan->state = FIP_VLAN_AVAIL;
                        list_add_tail(&vlan->list, &fnic->vlans);