From patchwork Thu Mar 8 09:31:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10267333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 013F760364 for ; Thu, 8 Mar 2018 09:31:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E59FC29816 for ; Thu, 8 Mar 2018 09:31:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9BEC2982C; Thu, 8 Mar 2018 09:31:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CBEB29816 for ; Thu, 8 Mar 2018 09:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755150AbeCHJbP (ORCPT ); Thu, 8 Mar 2018 04:31:15 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:54946 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbeCHJbM (ORCPT ); Thu, 8 Mar 2018 04:31:12 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w289P7hp057263; Thu, 8 Mar 2018 09:31:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=fjG38562QpYiGdcTbD4se4X54Z9iu4z0uAtHzdOn0ug=; b=GLBFgnMatrTKxBvSYh0l9joYRfhj58bQvHUr+PpjyAMtfV3+1XiP1fvGn3wSUx+ZejlZ D+5p4acmTIXhW/MD3qoHfwafZXmbU/AWrelo5KaBabG/Uo9SH5tf8krlpMM437YoRPrK GdurBYEku586VBZq1+HObuYMoZx+6fJpHRgT+kj+mXndNIn30ME6F/MnwrMgys0l0wU6 8FFdM/5NvqzNrxbGMferZHl8fKBD9JOBP2Ce+NLWipAxfkvWOOliqe/JDKU+8iH58Gru BuoSOgxjmJp1bh21gpLro3Kb4qWVEW129o83cBH8sZbxtufVbXH3embL3vCTa5GPXSdK ew== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2gk2h8g0rd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 08 Mar 2018 09:31:09 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w289V8fH011391 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 8 Mar 2018 09:31:08 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w289V81n031565; Thu, 8 Mar 2018 09:31:08 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 08 Mar 2018 01:31:07 -0800 Date: Thu, 8 Mar 2018 12:31:00 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab , Brad Love Cc: linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] media: em28xx-cards: fix em28xx_duplicate_dev() Message-ID: <20180308093100.GA16525@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.3 (2018-01-21) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8825 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=890 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803080116 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is a double sizeof() typo here so we don't duplicate the struct properly. Fixes: be7fd3c3a8c5 ("media: em28xx: Hauppauge DualHD second tuner functionality") Signed-off-by: Dan Carpenter diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 6e8247849c4f..6e0e67d23876 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -3515,7 +3515,7 @@ static int em28xx_duplicate_dev(struct em28xx *dev) dev->dev_next = NULL; return -ENOMEM; } - memcpy(sec_dev, dev, sizeof(sizeof(*sec_dev))); + memcpy(sec_dev, dev, sizeof(*sec_dev)); /* Check to see next free device and mark as used */ do { nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS);