Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761574AbaGRKjQ (ORCPT ); Fri, 18 Jul 2014 06:39:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41894 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761230AbaGRKiM (ORCPT ); Fri, 18 Jul 2014 06:38:12 -0400 From: Steven Whitehouse To: linux-kernel@vger.kernel.org, cluster-devel@redhat.com Cc: Fabian Frederick , Steven Whitehouse Subject: [PATCH 4/8] GFS2: replace count*size kzalloc by kcalloc Date: Fri, 18 Jul 2014 11:37:41 +0100 Message-Id: <1405679865-15728-5-git-send-email-swhiteho@redhat.com> In-Reply-To: <1405679865-15728-1-git-send-email-swhiteho@redhat.com> References: <1405679865-15728-1-git-send-email-swhiteho@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fabian Frederick kcalloc manages count*sizeof overflow. Cc: cluster-devel@redhat.com Signed-off-by: Fabian Frederick Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index 91f274d..4fafea1 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs/gfs2/lock_dlm.c @@ -1036,8 +1036,8 @@ static int set_recover_size(struct gfs2_sbd *sdp, struct dlm_slot *slots, new_size = old_size + RECOVER_SIZE_INC; - submit = kzalloc(new_size * sizeof(uint32_t), GFP_NOFS); - result = kzalloc(new_size * sizeof(uint32_t), GFP_NOFS); + submit = kcalloc(new_size, sizeof(uint32_t), GFP_NOFS); + result = kcalloc(new_size, sizeof(uint32_t), GFP_NOFS); if (!submit || !result) { kfree(submit); kfree(result); -- 1.8.3.1 -- 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/