Skip to contentSkip to conversation

staging: rts5139: use kzalloc() to close an info leak

PATCH New Dan Carpenter 1 participant 1 message Sep 23, 2012

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

PATCH 1/1 staging: rts5139: use kzalloc() to close an info leak

If we don't fill the whole buffer then there is information leaked to the user.

---
Hopefully this is only reachable by root so it's probably not such a big deal.

drivers/staging/rts5139/rts51x_fop.c +1 -1
index e1200fe..bf1a9e6 100644
@@ -79,7 +79,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip,
 
 	case 1:
 		/* Read from card */
-		buf = kmalloc(cmnd->buf_len, GFP_KERNEL);
+		buf = kzalloc(cmnd->buf_len, GFP_KERNEL);
 		if (!buf)
 			TRACE_RET(chip, STATUS_NOMEM);