Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp667886imu; Fri, 7 Dec 2018 07:09:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/WM5Voa/0zlzaOU4IBL8+Jaaxn/cX87c1gHslCWSoGR/o8YCKd4glkLGMtq1GfjUAVtwnf8 X-Received: by 2002:a63:fb46:: with SMTP id w6mr2267791pgj.321.1544195345817; Fri, 07 Dec 2018 07:09:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544195345; cv=none; d=google.com; s=arc-20160816; b=d+tFnCge8xp/bQzO77y6L8eosn04xi8yIfk4RalD/Tw6tjuA0Z6sp8RABzxrpWPcpF S53a3tAgbfUI8H+8dWZIkQOzF2yEQfayDxJS5twWKTVIHKffgY/iSg1po/+eugbW9Nkp +1/+EIHmcULd2e3hYvSE5evlg2RoKalTUbSR79znNT7UKT3UN0ZFPZgEDtrm+8Dm2gEN 6jz9EmAR286rAstvyTtp6MTFEmphyvPJsTDs+I2D0IZmPY/e2FOA7MD5jG6pUe0tGGOo UFDBcGzldpVpWwHMoMW/sUOV5YUvewBZLIkLpVLlgkY5D6xio6PXX2hlBZduAbHQoQAa KgjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:reply-to:forward-to :mail-followup-to:cc:to:subject:date:from; bh=UJEeOM039HkFqrOlxrFjb9iPJLj60B0YXprrN9jsczs=; b=GeP6Ny2btsq//fu0WzHjADo7i78YKCC32DimL6+D8vBoXGe6ao9ORrOyajZ5KkKKX8 6hxDzSQjCW5r1E50GRlhMwSKAeiay9AnbSm+08eADKTTUBqzT8RCo+IRgxr7oZzLAJ/3 2FYAmrMA8BCGJZunVZPhYiY23WDbVnFLogb4wnXNIvOVGejUcLeNnteutDtSdTuY5SSP 51nE/KgUmtqN0Ptpov2DwNVJJtsW6fcIb/X0Fw692Vnuy55kMIDD/6hHpby3f4QKmmpy HE8bY8YFQ4BOmDfXRm9kJmJ2iPCgtyPzreC/hpL9wNPFa9KFH+YC8SKH+BkMG4JZgWVw RRrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7si3111467plz.280.2018.12.07.07.08.49; Fri, 07 Dec 2018 07:09:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726135AbeLGPGA (ORCPT + 99 others); Fri, 7 Dec 2018 10:06:00 -0500 Received: from www.linuxtv.org ([130.149.80.248]:44637 "EHLO www.linuxtv.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbeLGPGA (ORCPT ); Fri, 7 Dec 2018 10:06:00 -0500 X-Greylist: delayed 943 seconds by postgrey-1.27 at vger.kernel.org; Fri, 07 Dec 2018 10:05:59 EST Received: from mchehab by www.linuxtv.org with local (Exim 4.84_2) (envelope-from ) id 1gVHSI-0002qP-UZ; Fri, 07 Dec 2018 14:50:14 +0000 From: Mauro Carvalho Chehab Date: Fri, 07 Dec 2018 14:42:18 +0000 Subject: [git:media_tree/master] media: siano: Use kmemdup instead of duplicating its function To: linuxtv-commits@linuxtv.org Cc: Tomoki Sekiyama , linux-kernel@vger.kernel.org, Wen Yang Mail-followup-to: linux-media@vger.kernel.org Forward-to: linux-media@vger.kernel.org Reply-to: linux-media@vger.kernel.org Message-Id: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an automatic generated email to let you know that the following patch were queued: Subject: media: siano: Use kmemdup instead of duplicating its function Author: Wen Yang Date: Thu Dec 6 07:29:10 2018 -0500 kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Tomoki Sekiyama CC: linux-kernel@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab drivers/media/usb/siano/smsusb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index be3634407f1f..2ffded08407b 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -225,10 +225,9 @@ static int smsusb_sendrequest(void *context, void *buffer, size_t size) return -ENOENT; } - phdr = kmalloc(size, GFP_KERNEL); + phdr = kmemdup(buffer, size, GFP_KERNEL); if (!phdr) return -ENOMEM; - memcpy(phdr, buffer, size); pr_debug("sending %s(%d) size: %d\n", smscore_translate_msg(phdr->msg_type), phdr->msg_type,