Skip to contentSkip to conversation

scsi: fnic: use kzalloc in fnic_fcoe_process_vlan_resp

PATCH Applied Rasmus Villemoes 2 participants 2 messages Jan 8, 2018 – Jan 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/scsi/fnic/fnic_fcs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/fnic/fnic_fcs.c +1 -3
index 999fc7547560..c7bf316d8e83 100644
@@ -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);
Signature · 1 line
2.15.1
#1 lore raw

Rasmus,

Quoted 2 lines

This saves a little .text and gets rid of the unmotivated line break and the sizeof(...) style inconsistency.

Applied to 4.16/scsi-queue. Thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering