lkml.org 
[lkml]   [2014]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] fs/gfs2/lock_dlm.c: replace count*size kzalloc by kcalloc
Hi,

Now in the -nmw git tree. Thanks,

Steve.

On 25/06/14 19:40, Fabian Frederick wrote:
> kcalloc manages count*sizeof overflow.
>
> Cc: Steven Whitehouse <swhiteho@redhat.com>
> Cc: cluster-devel@redhat.com
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> fs/gfs2/lock_dlm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> 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);



\
 
 \ /
  Last update: 2014-06-26 13:41    [W:0.030 / U:3.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site