Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp549804pxk; Wed, 9 Sep 2020 12:08:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzZDFRhQfFpy9fTVrOk0ZVji19++3J7YQTInRG9uSM+iPb4ly4SxSEFFNM9RbFy4VKGDwo X-Received: by 2002:a17:906:b04a:: with SMTP id bj10mr5094016ejb.303.1599678484999; Wed, 09 Sep 2020 12:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599678484; cv=none; d=google.com; s=arc-20160816; b=EgkkEEXPkUOwJogtx8TXj75rstKRdYWRY9+o/TP9ltWjBDMV56JnkIA9lfn+75H4E7 bFUHQccFCF/Y+Fxo2L4kju5KmSaGj31fYeqHXXhG0xFRTqDof7+z/Z6bxPvuN5o9JB4t qAgcl2CWw0WPhd3Z5cqyXlUdiHs4Bc3X9G0HCBOwHvoIL5ckiPJqbi/HTxeeUsp7NjtN CHkq37D8LCykhnIIovBUuPT5B49NoK01shURPeet8qDhfvtJh1bhCEA93yxGQxZMRqCR jmAICk5jhf7HRWpzjVLi/O8pWGJS5rNEXEz755V/dmT/NE2B19D5ihS8D8AzRH2gg3B1 uWrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=DL1SEibpeaqz3go7znBIkPpEohNdMbTETgjj6/Qc+uI=; b=IcpFW/+LCmQevafpjPNgTxYoLNrsroO7HUL+1F1TOFlaXXupT4GWEIpSoTNe8Qc7xO 6gIAIFxBTYdzZGBW5iXz32wj0HEmpVx/gu1uBArXpgTAXzcWfcJJ56EH0YYmpVieF5Ul a2JIENgWDBM0okaPmf3uhNLI4jVebYT6zedDS9kBBoiQHHovTA5tOqA6MABEg2CBbFLL FQS6WUSQQ5HpAx67E8ply0nnfnrUoF088we0a2txDURUGfU8CDiLnF3S/qtV3QSy5l81 aICChpW0IpKJIlmSGlFbpnrnABmm+7d7ZQ5T/olLNscqGRqnwyPueJXK5S++HN+EsXxi I5jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bGAYc71d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nz19si2067404ejb.516.2020.09.09.12.07.41; Wed, 09 Sep 2020 12:08:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bGAYc71d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729298AbgIITET (ORCPT + 99 others); Wed, 9 Sep 2020 15:04:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726184AbgIITES (ORCPT ); Wed, 9 Sep 2020 15:04:18 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5221FC061573 for ; Wed, 9 Sep 2020 12:04:18 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id t10so4129269wrv.1 for ; Wed, 09 Sep 2020 12:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=DL1SEibpeaqz3go7znBIkPpEohNdMbTETgjj6/Qc+uI=; b=bGAYc71dTBUOxZpxb7MWxow5YO9o0MBt1KqSE2i6A/MBqhBn839NsSqZeMoJMbawYF oU0KA7NSK55AppGuSbmHixR8pnue99eSMn2eEXpriKkdSWLHFU0e8GvU127KRvRHQ8GF RI19me743BgvvDuiXedHL9g/35MYle5WNbNGus79KBPU0bEcT9cG7u22U3ypXvJ7IutF qx9BY+ff6WNmhp9ikh48ylgrbs4blr0GxIWejb4ZnqBKnwTZZYnK3leh/zhHbMKRm/4Z 16hUjqkRI6sunC0YvSsXILW5Ti0OB85exvPkpcyOLSYDHy/q+i3MJqE2ZGF5OT+F4G4g qr+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=DL1SEibpeaqz3go7znBIkPpEohNdMbTETgjj6/Qc+uI=; b=MT6ezj2N+53iXgzgS/MHXLhMbH7SQ19+Fe6EMfnumiWrXtpFAsdNFqF8t8+l66+C7x CZT7FTPk5pUP7p080VsyZMo2TunVnRZfxJVZ1QZXluPMUnC0ZjOl52eX8HBFFxeP6vqS mggYehvDV6dp8VNQRm0JULNYNf4uVOecS+7G0Aky5ItPKpu2ERXWBXsAIvZEZ+77RWAU BytR1/192m8UR63arNKsuGNrkD4fbW1U66dv1VoeR6dIO0SiztC3PXEai1zgJKmVy+uC HdDbstgRHrjytawi4ZcHidEVkLaHgNw+MXPCKugdFuKxEzLLuVhhirSDJpV9YLYPEUtV VLAA== X-Gm-Message-State: AOAM533pUeuxDVuOj1ZxcmWwi8hFsfQJcCt5vKcxo3dTDVBRp9HlufBi cLlAO8wAPN4b47Vmmrw2pD9hNf4/xUc5XwFD X-Received: by 2002:adf:db43:: with SMTP id f3mr5634313wrj.219.1599678256633; Wed, 09 Sep 2020 12:04:16 -0700 (PDT) Received: from [192.168.0.16] (cpc83661-brig20-2-0-cust443.3-3.cable.virginm.net. [82.28.105.188]) by smtp.gmail.com with ESMTPSA id f1sm5492410wrt.20.2020.09.09.12.04.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Sep 2020 12:04:16 -0700 (PDT) Subject: Re: [PATCH] fs: omfs: use kmemdup() rather than kmalloc+memcpy To: Bob Copeland , linux-karma-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20200824211755.597245-1-alex.dewar90@gmail.com> From: Alex Dewar Message-ID: <5efaa7be-1890-0169-d133-8dd40b238d6d@gmail.com> Date: Wed, 9 Sep 2020 20:04:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200824211755.597245-1-alex.dewar90@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/08/2020 22:17, Alex Dewar wrote: > Issue identified with Coccinelle. Gentle ping? > > Signed-off-by: Alex Dewar > --- > fs/omfs/inode.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c > index b76ec6b88ded..8867cefa79cf 100644 > --- a/fs/omfs/inode.c > +++ b/fs/omfs/inode.c > @@ -363,12 +363,11 @@ static int omfs_get_imap(struct super_block *sb) > bh = sb_bread(sb, block++); > if (!bh) > goto nomem_free; > - *ptr = kmalloc(sb->s_blocksize, GFP_KERNEL); > + *ptr = kmemdup(bh->b_data, sb->s_blocksize, GFP_KERNEL); > if (!*ptr) { > brelse(bh); > goto nomem_free; > } > - memcpy(*ptr, bh->b_data, sb->s_blocksize); > if (count < sb->s_blocksize) > memset((void *)*ptr + count, 0xff, > sb->s_blocksize - count);