Skip to contentSkip to conversation

udl: zero out struct fb_deferred_io on allocation

PATCH New Nickolai Zeldovich 1 participant 1 message Jan 18, 2013

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

PATCH 1/1 udl: zero out struct fb_deferred_io on allocation

Ensure all fields of the struct fb_deferred_io are zeroed out on init, otherwise the fbdefio->first_io function pointer can contain garbage, and fb_deferred_io_mkwrite() will end up jumping to this garbage address.

---
 drivers/gpu/drm/udl/udl_fb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/udl/udl_fb.c +1 -1
index d4ab3be..40503ba 100644
@@ -301,7 +301,7 @@ static int udl_fb_open(struct fb_info *info, int user)
 
 		struct fb_deferred_io *fbdefio;
 
-		fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
+		fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
 
 		if (fbdefio) {
 			fbdefio->delay = DL_DEFIO_WRITE_DELAY;
Signature · 1 line
1.7.10.4