Skip to contentSkip to conversation

matrox: fix coccicheck warning in matroxfb_base.c

PATCH New Silviu-Mihai Popescu 1 participant 1 message Mar 11, 2013 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 matrox: fix coccicheck warning in matroxfb_base.c

This replaces a call to kmalloc() followed by memset() with just one call to kzalloc().

---
 drivers/video/matrox/matroxfb_base.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/video/matrox/matroxfb_base.c +1 -2
index 401a56e..2456529 100644
@@ -2029,10 +2029,9 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
 		return -1;
 	}
 
-	minfo = kmalloc(sizeof(*minfo), GFP_KERNEL);
+	minfo = kzalloc(sizeof(*minfo), GFP_KERNEL);
 	if (!minfo)
 		return -1;
-	memset(minfo, 0, sizeof(*minfo));
 
 	minfo->pcidev = pdev;
 	minfo->dead = 0;
Signature · 1 line
1.7.9.5