Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp651702rwr; Thu, 4 May 2023 08:00:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+5HZ/m3W5wfIoOkMT2QhnzC10/cJc5nFG1Qf2v1uaF3hqDnONwXkT7eplNAD4kPMqoQSo X-Received: by 2002:a05:6a20:918a:b0:f4:ac2d:8ea0 with SMTP id v10-20020a056a20918a00b000f4ac2d8ea0mr2859808pzd.32.1683212441395; Thu, 04 May 2023 08:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683212441; cv=none; d=google.com; s=arc-20160816; b=edpeH5bVgnuMBKO9v6jK/arMvkTCi+b6LLpafwb9v0iCKeT634f+aXAoaohw3nqpNr B+70xk4FR7pDr4y9LpqW/YquCUGSMvNKc0TCRwNGjwIa3M1L53nO1fE1Nm6Wpni4KshT +sFXj/0aZFNiQDRgu8Oa+Ty42kajEX2pvCujisenSHnTqroJ5glLUYz61Jr0X9yiN1H4 vRSJdaVAhj5v0Gaiyc2RQnglHVl2hBxgMXQm7MQWuc2HlTLK4aNlZdhhszMsMOI1jQ/G IJ5dzEQU51Tc3762BiYl6ekeA9DXmYKCIr9EYf5XuYISoCO5bR0ssN/rre0Z9MFYOs70 37Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lX/T27vjnEh8k9QeLjynwVpeQJ5Iqp1VjSSNsMcOBEs=; b=vIid9EsXSomiiQJl92OGGzMZZff3qBg9F36LaxtfIEPUxEPOw00Vt1oZV7cgAwBF4E TxFfU8sR13jd0IZt4qDZ2Edk9nYnCV5etzDxAsrUDAj6hPvo6fXiQJsSeBJdoc4ogDo/ 1LswR9TndHt8SkyzYSimXB5PXY7SfRmn+//CPzOg/iRAvTu1gNDKscr5EyCcnqyKAq/K m0D9YzEiu39bty5AiQmG+CMurKQP5u6ZQfiWhH2vPCPwru+118EaSCfO40/Lu5/f01zt Ygpp2vIDyr2LJCeZVYYivzArrBE8DoEKoT9iF8jmJz5OH8Ohyq5ou1uFkrXoAJJOTMRx WuUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QhHC7viA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t24-20020a63eb18000000b005139d2b9306si35548428pgh.514.2023.05.04.08.00.28; Thu, 04 May 2023 08:00:41 -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; dkim=pass header.i=@linaro.org header.s=google header.b=QhHC7viA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231395AbjEDOzQ (ORCPT + 99 others); Thu, 4 May 2023 10:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbjEDOzA (ORCPT ); Thu, 4 May 2023 10:55:00 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C9746596 for ; Thu, 4 May 2023 07:53:24 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f1950f569eso4699145e9.2 for ; Thu, 04 May 2023 07:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683211997; x=1685803997; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lX/T27vjnEh8k9QeLjynwVpeQJ5Iqp1VjSSNsMcOBEs=; b=QhHC7viAls5QeeFDlr8Zxb6K0EZlwkRgePgufMqP08s34GEK45rZTvj2Rj0/EqNLwA 0Q+PVahifxAYy4wnJlt9nFHcBO7gk7AROz7YCRzAHQfRbx4Wo9UFBw17ogFSOIED4oJb gCytz7C0GpOpIhQZ1PfuA3F3D5rT4vd4/xSlS7xjHQeB+lU3PcxRBkB3hevXwIsDb3I+ 3c8PtSzJvJ8ZVqosi1ECeolxhcEiPAD39C6nnBdMtuCuoT9zuNXi8BvX8fvja3JotePN fgOMDJhHJKF62H3E29aJw1a/vYRCCKoCk/H4RLqencEaoHC4TfjiEKDR+5myMhwr7t0z Og7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683211997; x=1685803997; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lX/T27vjnEh8k9QeLjynwVpeQJ5Iqp1VjSSNsMcOBEs=; b=QshmT/Sf5rBjq5xUyquWike3qEsL74WoKsWoF4Pmplpud5ie5l9GW9tDBq3xtsLavu Y26SpHrNhHvMA03DsolVrWzMBP2veA4rnIb+A810Z8b7ijWtTJzw3VIogLdInS1jHi+t l41T1CLf1Q61qSbHc/6jLOES0LwlBXZB9rjBX9jZ5UN9YJD/4yeBbCSCFmQ5tXhDDakF 5maDxLttBT7/EkRnnz3kqu3fV/8NnS2D6gjhRILBmqgxzUo5W9+BD5Xg4l1er0ztyBRr YFKCoOWp7I20QPIAZjDXvdfTBbSt8qM3ABdnijqGL57DMWfrEJ+klopdTQZ9ONCRSGoU 9vYA== X-Gm-Message-State: AC+VfDzDIgW2ekc8hfD4bE7YkNsOVeMRIF2F4/QiMfmxgGrLQpZZ5CBz 4qgjmkadmKXzr6CmKTQt3z3U9Q== X-Received: by 2002:a05:600c:2104:b0:3f1:6f44:ff3a with SMTP id u4-20020a05600c210400b003f16f44ff3amr17146491wml.13.1683211996867; Thu, 04 May 2023 07:53:16 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id m20-20020a7bce14000000b003f3195be0a0sm5161389wmc.31.2023.05.04.07.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 07:53:15 -0700 (PDT) Date: Thu, 4 May 2023 17:53:02 +0300 From: Dan Carpenter To: Dongliang Mu 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 Subject: Re: [PATCH] drivers: staging: greybus: fix GPF issue in gb_camera_capture Message-ID: References: <20230504135841.1566958-1-dzm91@hust.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230504135841.1566958-1-dzm91@hust.edu.cn> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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. I don't see a bug. regards, dan carpenter