Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756491AbaFWQrL (ORCPT ); Mon, 23 Jun 2014 12:47:11 -0400 Received: from mailrelay005.isp.belgacom.be ([195.238.6.171]:62664 "EHLO mailrelay005.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755369AbaFWQrJ (ORCPT ); Mon, 23 Jun 2014 12:47:09 -0400 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApkHAOpYqFNbskjJ/2dsb2JhbABZgw2rZgUBAQEBAQEFAZk1gQ8XdYQxLyOBGjeIRgHEJxeFY4kZHYQtBJpMk2ODRDs From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: Fabian Frederick , Anton Vorontsov , Colin Cross Subject: [PATCH 1/1] fs/pstore/ram.c: replace count*size kzalloc by kcalloc Date: Mon, 23 Jun 2014 18:45:49 +0200 Message-Id: <1403541949-11131-1-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 1.8.4.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kcalloc manages count*sizeof overflow. Cc: Anton Vorontsov Cc: Colin Cross Signed-off-by: Fabian Frederick --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/