Skip to content

Commit

Permalink
scsi: fnic: use kzalloc in fnic_fcoe_process_vlan_resp
Browse files Browse the repository at this point in the history
This saves a little .text and gets rid of the unmotivated line break and
the sizeof(...) style inconsistency.

Signed-off-by: Rasmus Villemoes <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
Villemoes authored and martinkpetersen committed Jan 17, 2018
1 parent 87058dd commit dbc1ebe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/scsi/fnic/fnic_fcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dbc1ebe

Please sign in to comment.