Messages in this thread Patch in this message | | | From | Fabian Frederick <> | Subject | [PATCH 1/1] fs/pstore/ram.c: replace count*size kzalloc by kcalloc | Date | Mon, 23 Jun 2014 18:45:49 +0200 |
| |
kcalloc manages count*sizeof overflow.
Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Signed-off-by: Fabian Frederick <fabf@skynet.be> --- fs/pstore/ram.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 3b57443..87aa37c 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -347,8 +347,7 @@ static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt, if (!cxt->max_dump_cnt) return -ENOMEM; - cxt->przs = kzalloc(sizeof(*cxt->przs) * cxt->max_dump_cnt, - GFP_KERNEL); + cxt->przs = kcalloc(cxt->max_dump_cnt, sizeof(*cxt->przs), GFP_KERNEL); if (!cxt->przs) { dev_err(dev, "failed to initialize a prz array for dumps\n"); goto fail_prz; -- 1.8.4.5
| |