All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fixes for Incorrect kmalloc() Sizes
@ 2001-05-09  6:24 david chan
  2001-05-09 20:19 ` David
  0 siblings, 1 reply; 3+ messages in thread
From: david chan @ 2001-05-09  6:24 UTC (permalink / raw)
  To: Linus Torvalds, emu10k1-devel, Ed Okerson; +Cc: linux-kernel

Hi,

These two patches fix silly kmalloc errors that allocate too little space.


Thank you,
David Chan


---snip---
--- drivers/sound/emu10k1/midi.c.orig	Fri Feb  9 11:30:23 2001
+++ drivers/sound/emu10k1/midi.c	Tue May  8 19:43:43 2001
@@ -56,7 +56,7 @@
 {
 	struct midi_hdr *midihdr;

-	if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr
*), GFP_KERNEL)) == NULL) {
+	if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct
midi_hdr), GFP_KERNEL)) == NULL) {
 		ERROR();
 		return -EINVAL;
 	}
@@ -328,7 +328,7 @@
 	if (!access_ok(VERIFY_READ, buffer, count))
 		return -EFAULT;

-	if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr
*), GFP_KERNEL)) == NULL)
+	if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct
midi_hdr), GFP_KERNEL)) == NULL)
 		return -EINVAL;

 	midihdr->bufferlength = count;
---snip---

---snip---
--- drivers/telephony/ixj.c.orig	Tue May  8 20:00:07 2001
+++ drivers/telephony/ixj.c	Tue May  8 20:00:25 2001
@@ -4475,7 +4475,7 @@
 {
 	IXJ_FILTER_CADENCE *lcp;

-	lcp = kmalloc(sizeof(IXJ_CADENCE), GFP_KERNEL);
+	lcp = kmalloc(sizeof(IXJ_FILTER_CADENCE), GFP_KERNEL);
 	if (lcp == NULL)
 		return -ENOMEM;
 	if (copy_from_user(lcp, (char *) cp, sizeof(IXJ_FILTER_CADENCE)))
---snip---





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-05-09 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-09  6:24 [PATCH] Fixes for Incorrect kmalloc() Sizes david chan
2001-05-09 20:19 ` David
2001-05-09 20:57   ` Alan Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.