Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fdbe5cf authored by Jean Delvare's avatar Jean Delvare Committed by Linus Torvalds
Browse files

[PATCH] matroxfb: Use kzalloc



Use kzalloc instead of kmalloc+memset, twice.

Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
Acked-By: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c30660ea
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -146,7 +146,7 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) {
	unsigned long flags;
	unsigned long flags;
	struct matroxfb_dh_maven_info* m2info;
	struct matroxfb_dh_maven_info* m2info;


	m2info = kmalloc(sizeof(*m2info), GFP_KERNEL);
	m2info = kzalloc(sizeof(*m2info), GFP_KERNEL);
	if (!m2info)
	if (!m2info)
		return NULL;
		return NULL;


@@ -155,8 +155,6 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) {
	matroxfb_DAC_out(PMINFO DAC_XGENIOCTRL, 0x00);
	matroxfb_DAC_out(PMINFO DAC_XGENIOCTRL, 0x00);
	matroxfb_DAC_unlock_irqrestore(flags);
	matroxfb_DAC_unlock_irqrestore(flags);


	memset(m2info, 0, sizeof(*m2info));

	switch (ACCESS_FBINFO(chip)) {
	switch (ACCESS_FBINFO(chip)) {
		case MGA_2064:
		case MGA_2064:
		case MGA_2164:
		case MGA_2164:
+1 −2
Original line number Original line Diff line number Diff line
@@ -694,12 +694,11 @@ static void* matroxfb_crtc2_probe(struct matrox_fb_info* minfo) {
	/* hardware is CRTC2 incapable... */
	/* hardware is CRTC2 incapable... */
	if (!ACCESS_FBINFO(devflags.crtc2))
	if (!ACCESS_FBINFO(devflags.crtc2))
		return NULL;
		return NULL;
	m2info = kmalloc(sizeof(*m2info), GFP_KERNEL);
	m2info = kzalloc(sizeof(*m2info), GFP_KERNEL);
	if (!m2info) {
	if (!m2info) {
		printk(KERN_ERR "matroxfb_crtc2: Not enough memory for CRTC2 control structs\n");
		printk(KERN_ERR "matroxfb_crtc2: Not enough memory for CRTC2 control structs\n");
		return NULL;
		return NULL;
	}
	}
	memset(m2info, 0, sizeof(*m2info));
	m2info->primary_dev = MINFO;
	m2info->primary_dev = MINFO;
	if (matroxfb_dh_registerfb(m2info)) {
	if (matroxfb_dh_registerfb(m2info)) {
		kfree(m2info);
		kfree(m2info);