Received: by 10.192.165.148 with SMTP id m20csp3911900imm; Mon, 30 Apr 2018 08:27:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrHMnb3PFu+XpD+Ml7OSAoK/kymVbv48JtWIfQGv8eGyUujm7MndWxZjDTeaJ2WTXpVihKy X-Received: by 2002:a17:902:4c88:: with SMTP id b8-v6mr2133969ple.285.1525102020292; Mon, 30 Apr 2018 08:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525102020; cv=none; d=google.com; s=arc-20160816; b=poAHYRm5G237UzR9edJ3i4dCFBZSNyIBAxgONjn6ucz8xmI795TeHZZ3fQw6lX51QI VUmWsa5r33dbnXF6p/abOYAGeCT+xhJwna+QfpWY//G6XkW+eOM5qMfdGMgs/7vC0lOi OblCA/4YGPVgFHdv4aMcUuFLu7wu63dUT+s7BJ956jzPcRoilmb4dFRgJ/14vHEKU/2p oQDo72ayAU2uADTaHH0cyG1C91MaXfOp2yKB2Gcaizt1q7dWiKm/0R4nqr9R6rF3DwD6 NEEnt25oJ3Z/6YLdEFfyigJiYvxGLzQEibSt2g17fBVRpNzARSmU2qQ3kt8Q6RN+w2WY m9rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=UNs1u2K2py9Q1mpqgKON36xeZCmgZrZz2qYUHCda6Tc=; b=HeWfqDXoBYrHqVXGX7IyKrhQM7Wr+N9jHFpzcYLLUFdKJwAdcTBEyjgHuzjxijC1My AgVkt7mHY4jqME+GHKK6j1t1wuxWo1qHinoe9bKeXvLpYuqhRfPhq2/wwzp+hLzBWM/+ bxc2dTN/wtrsvBTzhwPotcqoGB9E560PaV6Ex3n0ltu7ufE/XyHPWY24dGOCSHeJfe0u 2cSihhXo2kGM2l737CMj0y5KWTG21CvOlrlbepeZR1Ous+qybtwHFRI7ZMOfTXcCWerK I59wJkU8X4mACw7gt154Wa+sNSJ9X01BmWTGdZaoPJWlHWLTtUhPFKy/nXO5nUC1QItF 7r0w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23-v6si2178075pgd.457.2018.04.30.08.26.45; Mon, 30 Apr 2018 08:27:00 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754582AbeD3P0a (ORCPT + 99 others); Mon, 30 Apr 2018 11:26:30 -0400 Received: from gateway23.websitewelcome.com ([192.185.50.129]:31172 "EHLO gateway23.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752939AbeD3P02 (ORCPT ); Mon, 30 Apr 2018 11:26:28 -0400 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 9F3A416F0E for ; Mon, 30 Apr 2018 10:26:27 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id DAh9fFn0ilAdrDAh9fomXd; Mon, 30 Apr 2018 10:26:27 -0500 X-Authority-Reason: nr=8 Received: from [187.172.56.86] (port=59962 helo=[192.168.1.74]) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1fDAh9-003xkh-6j; Mon, 30 Apr 2018 10:26:27 -0500 Subject: Re: [PATCH][next] media: ispstat: don't dereference user_cfg before a null check To: Sakari Ailus , Laurent Pinchart Cc: Colin King , Mauro Carvalho Chehab , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180424130618.18211-1-colin.king@canonical.com> <20180426083731.72bmygsp2waf3eeu@valkosipuli.retiisi.org.uk> <2302951.d1m0yxIoYN@avalon> <20180430151503.d3kq2zomil6uh2xf@valkosipuli.retiisi.org.uk> From: "Gustavo A. R. Silva" Message-ID: <9c1e7c1e-c391-4b91-7836-61a8b9d5489a@embeddedor.com> Date: Mon, 30 Apr 2018 10:26:25 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180430151503.d3kq2zomil6uh2xf@valkosipuli.retiisi.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.172.56.86 X-Source-L: No X-Exim-ID: 1fDAh9-003xkh-6j X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.1.74]) [187.172.56.86]:59962 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 7 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari, On 04/30/2018 10:15 AM, Sakari Ailus wrote: >> Isn't there a guarantee that new_buf won't be NULL ? The new_buf pointer comes >> from the parg variable in video_usercopy(), which should always point to a >> valid buffer given that the ioctl number specifies a non-zero size. > > Fair question. After looking at the code, I agree with you; there should be > no reason to perform the check in the first place. It may have been that > the function has been used differently in the past but the check should be > rather removed now. > > I'll drop the patch. > Please, if the check isn't needed anymore, make sure it is removed. This helps to reduce the number of false positives reported by static analyzers. Thanks -- Gustavo