Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp708512rwr; Thu, 4 May 2023 08:36:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5L4Ij8CxjMbm8b/9cG5M+qF6wM8WSuD+MviWv6cknMrNFfmdvBiq3wCk3conYGX3tbeZlw X-Received: by 2002:a05:6a00:1a8d:b0:63f:ffd:5360 with SMTP id e13-20020a056a001a8d00b0063f0ffd5360mr3077741pfv.21.1683214566725; Thu, 04 May 2023 08:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683214566; cv=none; d=google.com; s=arc-20160816; b=Mftr2dK5PksLkEjvKPjLoEqj5KKsAEVz5QgAJ/DRLDUUuhYR07BnbU+sgLubyVtEeu VloVKy5OxvqWDctViHFPtsI+Gw+6VcuPkexMLxkHyPg32rDLSMVdrGaz2dBHVeU5Aic3 bKCy7wqm9LqblelIRLtXBtHp7yFNgYQKb7MC7eIDA1DleMc33vozMUI62EWohO5zCDjt PlIjHowRTOjooRJMbzki4t1WD3zxWZbHn7prNL/welEE6u9i8rduevgBnPnOZ2D6GFGL TldhzTV29IVh//XYRED8OoF5b2kv85eBN5etMFWstqHwO9bkkBnhJ4sJa3dFcgDy+7rh Vqhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=hbSzFM+yPnJ/vYBPdciWlBddmr6OQRqXWJ+0rHntKUw=; b=DqC6EK0NS6133TLOM5jfndW4bUzC1CePaZOoZzmgcLyVE2MG507og6ZgH7eOXYazmi bqEz8ujBdxivOUyt25Mk/JNohJJzLN6Bm9UbIA2720fru+PI3AuLLkWj82DvmfwUxf5d sgHWYl50jWjb69S5tgAq1KIzeCQC44E9r1VOyPUA0PBTaeEZDNmU/idyL2ZOBCWiTgn4 WWBXdNUDAD4ZNaLiKyOQLYo/xNZfCEtlGSen3tZ2tgcXXJdDnDW5ZdetynW0rVgCZZkY w5tYWMDGvZm4Uae9xiuYZsgcstlfzVCcCfgdfYWtA2a2lQlINK84yB5eIIj0ZZ05JLIv Ng8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 185-20020a6301c2000000b00517d81adf05si36866427pgb.844.2023.05.04.08.35.54; Thu, 04 May 2023 08:36:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbjEDPJ4 (ORCPT + 99 others); Thu, 4 May 2023 11:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231128AbjEDPJq (ORCPT ); Thu, 4 May 2023 11:09:46 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6FF544A1 for ; Thu, 4 May 2023 08:09:42 -0700 (PDT) Received: from [192.168.1.5] ([183.94.69.234]) (user=dzm91@hust.edu.cn mech=PLAIN bits=0) by mx1.hust.edu.cn with ESMTP id 344F8TQO000684-344F8TQP000684 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 4 May 2023 23:08:29 +0800 Message-ID: <6b0523d1-c8ff-d746-bf50-ddabadd07bcf@hust.edu.cn> Date: Thu, 4 May 2023 23:08:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] drivers: staging: greybus: fix GPF issue in gb_camera_capture To: Dan Carpenter Cc: Johan Hovold , Alex Elder , Greg Kroah-Hartman , Jacopo Mondi , Laurent Pinchart , Greg Kroah-Hartman , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20230504135841.1566958-1-dzm91@hust.edu.cn> From: Dongliang Mu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-FEAS-AUTH-USER: dzm91@hust.edu.cn X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/4/23 PM10:53, Dan Carpenter wrote: > On Thu, May 04, 2023 at 09:58:41PM +0800, Dongliang Mu wrote: >> In gb_camera_capture(), it does not check the value of settings >> before dereferencing it. And gb_camera_debugfs_capture calls >> gb_camera_capture with the 6th parameter settings as NULL. >> >> Fix this by checking the value of setting at the starting of >> gb_camera_capture. >> >> Fixes: 3265edaf0d70 ("greybus: Add driver for the camera class protocol") >> Signed-off-by: Dongliang Mu >> --- > No. The original code is correct. memcpy(p, NULL, 0); is allowed. Oh, I see. This memcpy with src as NULL and len as zero is intended. Thanks, Dan. Sorry for the false alarm, guys. > I don't see a bug. > > regards, > dan carpenter