summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-09-13 15:16:09 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:33 +1100
commit99a09bc4fe16d275b2bf839cb8f37192b2235e24 (patch)
tree861ba173e6499f7a7c89c99f1ce9a669dfe98c95
parentae40030429b19a8d22517e99bd604cac8b37fd6e (diff)
Fix kernel crash, where kzalloc is not alloc'ing enough memory!
The memory originally being allocated was not for a *, but for a **, hence the kernel crashes due to memory not being adequately allocated. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rwxr-xr-xalsa.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/alsa.c b/alsa.c
index a8609b4..a899bb1 100755
--- a/alsa.c
+++ b/alsa.c
@@ -65,8 +65,7 @@ static int alloc_dev_config(struct avirt_alsa_devconfig **devconfig,
if (numdevices == 0)
return 0;
- *devconfig = kzalloc(sizeof(*devconfig) * numdevices,
- GFP_KERNEL);
+ *devconfig = kzalloc(sizeof(**devconfig) * numdevices, GFP_KERNEL);
if (!(*devconfig))
return -ENOMEM;