Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1739313ybg; Sat, 19 Oct 2019 01:27:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTjn97xBSkqI1XN8jkRC+ER3isxBkA+ZqQHfUl/VuFEwdczJoki4GObVgWfcMwL0bDu7Wk X-Received: by 2002:a17:906:8556:: with SMTP id h22mr12078504ejy.296.1571473657119; Sat, 19 Oct 2019 01:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571473657; cv=none; d=google.com; s=arc-20160816; b=qg98B9oyGuDVeyRpnwww6xSqwb2jeIM8C0YD7k2KCiPHy8FsTljZI43ovIhzLmUkUc 7lP1T/LFVeeMOWmZR6UpdCQv5WRePybFRsakQb4dGJVhS1jZHIsr4RyNIaqO4Qu5mR/4 PQeN0nXyLoc9S0MMKgUkScM4V/6pKNURERllaYcTPfLWDcrruIXRukaomRY9EeGvp0Ly S/e42GymePGm4p5aY5RRILKO0Z2BzCFqnE0zVvUwhWfDC41+tIgHuEJlkfAO/tLlz2mi 2cA0KrSsVOOAihEIQ8fuTw9/vM6bRj0h+4O6jnPQakwkcd2YeBkO/SEMczqzvoVDA3zi V5tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XDsR3uMfXkgF7u6HALnY0iXOM6iF9eRUOFTw+nG58FU=; b=oxakJ/S+JATzgc+2KcOdKdXueKLU7Y6KRId7R1S5L4hHs5TYDNUFAZbx5BC45uvOy3 BuxYnokolGGxv+FCRoCSvvfISrfd1zC68fL+cFU2cK/MT8uTkLZ1KOFck5hH8qibMdc7 +q2s1lauNgiEJ62KZRpD/wWaS61dAuk1lNAIomwFgm1vzaKKDRHwVRT8EIyZZ8uc64ne URwTGPT9Q5/8XhBZHARAhXYVBHSodfHL64nruWbSjLRk/AvlF/VmVH9OqDoGQlB1VLVa Vrubx1WoENugukWvYiI5SS4qWuvkUhIcKGhl1Mwwmxrk3vg6chtqf6UUxTkkeTyqokAm VFBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="s/332UPV"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u16si4696387ejx.179.2019.10.19.01.27.14; Sat, 19 Oct 2019 01:27:37 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="s/332UPV"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2410180AbfJROEf (ORCPT + 99 others); Fri, 18 Oct 2019 10:04:35 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38163 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408654AbfJROEe (ORCPT ); Fri, 18 Oct 2019 10:04:34 -0400 Received: by mail-pg1-f194.google.com with SMTP id w3so3446857pgt.5; Fri, 18 Oct 2019 07:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XDsR3uMfXkgF7u6HALnY0iXOM6iF9eRUOFTw+nG58FU=; b=s/332UPVcH1YG4ye19Mtt+q/dq09kM3b0whWofT6iOrvdLjKeNJSYkEGYFV41HwrJ+ NWTQw49T0F9jwGWvwScp1UZ2t847mGaAFXXulMv9mGQAJLsG3dKWHgREe0FpOs6jVYWK cppS7aPIqstVZHnSUo3gHthlzVCgIAjPKB5T0vMa1tMxCUgxWuDmLC+RQT/E6RHfjHDC AqSTsQDXzjEWd/gfhgAYV3UjuuJtrtpN/6tAuKaAU/ghmYpCssDi7ZljlQIV/F5zRKrX TWEOv8hq5IVZpBOqM1H9GQ9T/oMyHsN53zFGEZmTr+uA1ka0S8bMJoWEGMXfMR0uDHxe aVkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XDsR3uMfXkgF7u6HALnY0iXOM6iF9eRUOFTw+nG58FU=; b=M1g3JUbOoZsVDjdyERFUL8jVd7PIfRJQynGrwPzRSG1M9wbGBRflDgLhpiFIvIXBCc liCcKlyxKYlMBYebpC/ggiwm7skM/8ZZmz8vxDQICpBbK5tz/JUaAXNoGZU8EDcGEJhc 0FMi5nyxo2o0B8UcrkvWlRsgR1lrl3mM02nrd0KzU4hQtUVZLPaMSuWBJQknyP7+B5vE Pl8VxJ3XfpcL3Hz/8Am+lDC4ZTLp74KnXl/TTiOmvm2keuZ5Bl4bfb15lpkwan7l7vjH LAnMPgyek5FT3MIYtD2lZD1dJbkQ7XZNTlovuuBeRHcoMIcIHLi3Qy8Fcy9GDQxCx6+m +m5w== X-Gm-Message-State: APjAAAUMfS4d4f+Li92/M+FWk+VcuOYxXxHreJ/l++u+AjmKAxtr2Fja 27Kd8nY1A5Nja6zKE7l+ckcee+uC6bB3Yv/T65M= X-Received: by 2002:a17:90a:9416:: with SMTP id r22mr11549632pjo.20.1571407473810; Fri, 18 Oct 2019 07:04:33 -0700 (PDT) MIME-Version: 1.0 References: <20191017025058.31528-1-hslester96@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Fri, 18 Oct 2019 17:04:22 +0300 Message-ID: Subject: Re: [PATCH] spi: pxa2xx: Add missed security checks To: Chuhong Yuan Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown , linux-arm Mailing List , linux-spi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 18, 2019 at 2:37 PM Chuhong Yuan wrote: > On Fri, Oct 18, 2019 at 7:14 PM Andy Shevchenko > wrote: > > On Fri, Oct 18, 2019 at 1:39 PM Chuhong Yuan wrote: > > > On Fri, Oct 18, 2019 at 5:35 PM Andy Shevchenko > > > wrote: > > > > On Fri, Oct 18, 2019 at 8:59 AM Chuhong Yuan wrote: > > > > I'm not sure they are mandatory for all platforms. > > > > To be on the safe side, you simple need to add _optional() to the both > > > > call along with above change. > > > > > > > > > > As I know, this is the only one in spi which does not have a check for > > > devm_clk_get. > > > > For some it still may be optional. That's why better to check it and > > mention in the commit message. > > > > > Even if add _optional(), they still may return errors and need security checks. > > > > Of course, see "along with" in my previous comment. > > > > Got it. I will send version 2 in which both _optional() and security > checks will be added. Let me be clear. I didn't check if _optional() needed or not. You need to investigate this before sending new verison. And in either case this should be explained in commit message. -- With Best Regards, Andy Shevchenko