Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7450
b: refs/heads/master
c: 8db08ea
h: refs/heads/master
v: v3
  • Loading branch information
Pekka Enberg authored and Linus Torvalds committed Sep 7, 2005
1 parent c0fa1c4 commit 15a5dbe
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e915fc497a8da551f32b7e5fda687eb4a10bc23b
refs/heads/master: 8db08ea7e6527eff82d8e45507468003e3cefba3
2 changes: 2 additions & 0 deletions trunk/include/sound/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,14 @@ void snd_memory_done(void);
int snd_memory_info_init(void);
int snd_memory_info_done(void);
void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags);
void *snd_hidden_kzalloc(size_t size, unsigned int __nocast flags);
void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags);
void snd_hidden_kfree(const void *obj);
void *snd_hidden_vmalloc(unsigned long size);
void snd_hidden_vfree(void *obj);
char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags);
#define kmalloc(size, flags) snd_hidden_kmalloc(size, flags)
#define kzalloc(size, flags) snd_hidden_kzalloc(size, flags)
#define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags)
#define kfree(obj) snd_hidden_kfree(obj)
#define vmalloc(size) snd_hidden_vmalloc(size)
Expand Down
14 changes: 10 additions & 4 deletions trunk/sound/core/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,21 @@ void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags)
return _snd_kmalloc(size, flags);
}

void *snd_hidden_kzalloc(size_t size, unsigned int __nocast flags)
{
void *ret = _snd_kmalloc(size, flags);
if (ret)
memset(ret, 0, size);
return ret;
}
EXPORT_SYMBOL(snd_hidden_kzalloc);

void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags)
{
void *ret = NULL;
if (n != 0 && size > INT_MAX / n)
return ret;
ret = _snd_kmalloc(n * size, flags);
if (ret)
memset(ret, 0, n * size);
return ret;
return snd_hidden_kzalloc(n * size, flags);
}

void snd_hidden_kfree(const void *obj)
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/ali5451/ali5451.c
Original file line number Diff line number Diff line change
Expand Up @@ -2249,7 +2249,7 @@ static int __devinit snd_ali_create(snd_card_t * card,
return -ENXIO;
}

if ((codec = kcalloc(1, sizeof(*codec), GFP_KERNEL)) == NULL) {
if ((codec = kzalloc(sizeof(*codec), GFP_KERNEL)) == NULL) {
pci_disable_device(pci);
return -ENOMEM;
}
Expand Down

0 comments on commit 15a5dbe

Please sign in to comment.