Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5978260ybp; Tue, 15 Oct 2019 07:51:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOgjflpnUkqrqxm+GWTbxx9PyakwM7GAkTsxOAI0RE9sI9tCvkqI4zkLD0TSSrh/4zrrfd X-Received: by 2002:a17:906:790:: with SMTP id l16mr36104725ejc.270.1571151096759; Tue, 15 Oct 2019 07:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571151096; cv=none; d=google.com; s=arc-20160816; b=giQZCCQ3pyKCqyFUqS4FdNDiz6lF2K0VASceO1uKlpHLRIDvKPSN209akxWv00OjUp SI1Ngxx8rEbuL3GNceIuh3ensDLziE9SumyHNcCqFMo/ha6ekCJVNy6frI6mTwH/uvEP bSZoglg4STWevoZ3Fgt0OWJNPDGyMB/9x9jzXZDPryJBTmlG2DPTQfzQjxEotQpzJNC/ Pe98fX2+akjjv2nIq10OZvThU9ptuvXUrmzwU15YHpaS3k8UXbMzyAE7fJcSyn5Ou9OQ pjstS36b9NVjo3FxhvkIYuRplEnCZW/1q0D9FcobywKRsvzGgpYzvMWkEUjhnBUUb/e+ +PaQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MnfGhBwoMQVplo0Mxn7uRwpUlFBd/nvB/PMi8g7Xh1U=; b=WCKfYRASpIpodYf+n9N1/HVgQoYYzkOEJ4e1QMpcNb5u6cUYNzVYKX3IGRti9CLmss 4hVx+wqEilMR7VNvdoEangTPQ4F1tR3AtL/7lzG5LXhsOkBozVc2JUKx4yR2gihZubyJ YCKdicg3t6B5i9ey7PiFQzVQY7D6lhE/OIxzDa+NHXpPyo8Dntf2w7G6cveBU7nbTkKI qqWXYR5b/LnZ8IagfPNOgjhHDjTmK+iSrrwMrNLU1kzEKfqtItdkF1Snhfw5uIxSq5l2 y8g6dROTB38OR0B7CVsxFZKSc2Q3OWPUegEC0oJoJb+VeDFEay6tmwSoyWI0VTfRuCnK FAzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HpChALqW; 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 x25si15548782edd.350.2019.10.15.07.51.13; Tue, 15 Oct 2019 07:51:36 -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=HpChALqW; 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 S1733064AbfJOOtv (ORCPT + 99 others); Tue, 15 Oct 2019 10:49:51 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:46769 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732949AbfJOOtu (ORCPT ); Tue, 15 Oct 2019 10:49:50 -0400 Received: by mail-io1-f68.google.com with SMTP id c6so46371101ioo.13; Tue, 15 Oct 2019 07:49:50 -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:content-transfer-encoding; bh=MnfGhBwoMQVplo0Mxn7uRwpUlFBd/nvB/PMi8g7Xh1U=; b=HpChALqW5ydj92GSRYuzlp/a2ptuL2yYJa9gu43hB86GrFD2wsntp8ZwrGiipcl4Io 1+Jp8HIXVFih7E4dj18vLN2+zF7PktHbNlCWjgUVqLzofRBzEg5UyGO8Ytvk9VI8D+Rb ixa92S1aqah9LEEOfHVsw2rfoIUvuyFFFyENM98IzYOT3NeRZEjBSZ5kvrHCpqZsQK8d pkVkSYaflHnt0uHjPTtSvChOsK6mlx/tla+N6pBcZmdk1DYhNGzPtrwwEyYUTnmZ4ARc KhvCYtl3MJ/HznGBMkU+jGXry/UWXhsE2hF8k+vzbIAsl5FI0/DfEoGTENgs1ff8g9q/ DXpA== 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:content-transfer-encoding; bh=MnfGhBwoMQVplo0Mxn7uRwpUlFBd/nvB/PMi8g7Xh1U=; b=ALnBrhIEsSo45W0YNxWQGRDpGq20UGLIgL51jH/IxWxdib7we+Nbx/urudcz3o/3mN gvGtaWYBgfn/82bPhSydz+RP0x+KwvcJuTtwFNj4+JYe7YBdeDJB5ar6nvm4X5Jx5ZsW G6hEHTMimFrmqfhnmlZ54+6FtsXErpO8OoQLXFE8ZrD8yPm/5WGolj8UbYKalBd4T59D bRHqi594gvT8wORtOWGZo9p6rNyQ25d0mgHnAPgkaQ09APoGyUO/lbWfZ1gtPdGvULgK Qkzf0WvFjWcip94s56wZ4J/1arMPtqxQaDP6p8qnQ2s8b+YRcWPgsy+UMVRV3fC13p7d vZPQ== X-Gm-Message-State: APjAAAWTTAW5UlWQHVFm4b1nfkQGN06FF/2f4EROGzJqZA+CmxVd0kQS 1CaGN+O5+iCIv5P7rH0hvsq4UEDCWK/loDgFwDo= X-Received: by 2002:a92:9ecd:: with SMTP id s74mr2230665ilk.145.1571150989602; Tue, 15 Oct 2019 07:49:49 -0700 (PDT) MIME-Version: 1.0 References: <7933ce8f-ca1b-6ed8-14b9-59679130dc47@web.de> In-Reply-To: <7933ce8f-ca1b-6ed8-14b9-59679130dc47@web.de> From: Tomasz Figa Date: Tue, 15 Oct 2019 23:49:39 +0900 Message-ID: Subject: Re: clk: samsung: Checking a kmemdup() call in _samsung_clk_register_pll() To: Markus Elfring Cc: "open list:COMMON CLK FRAMEWORK" , "moderated list:SAMSUNG SOC CLOCK DRIVERS" , Chanwoo Choi , Michael Turquette , Stephen Boyd , Sylwester Nawrocki , LKML , kernel-janitors@vger.kernel.org, Aditya Pakki , Kangjie Lu , Navid Emamdoost , Stephen McCamant Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Markus, 2019=E5=B9=B410=E6=9C=8812=E6=97=A5(=E5=9C=9F) 23:17 Markus Elfring : > > Hello, > > I tried another script for the semantic patch language out. > This source code analysis approach points out that the implementation > of the function =E2=80=9C_samsung_clk_register_pll=E2=80=9D contains also= a call > of the function =E2=80=9Ckmemdup=E2=80=9D. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/d= rivers/clk/samsung/clk-pll.c?id=3D1c0cc5f1ae5ee5a6913704c0d75a6e99604ee30a#= n1275 > https://elixir.bootlin.com/linux/v5.4-rc2/source/drivers/clk/samsung/clk-= pll.c#L1275 Thanks for the report. > > * Do you find the usage of the format string =E2=80=9C%s: could not alloc= ate > rate table for %s\n=E2=80=9D still appropriate at this place? Yes, AFAICT there is nothing wrong with that format string. > > * Is there a need to adjust the error handling here? No, there isn't much that can be done if we fail the allocation at such an early stage. That said, there is no need to print any warnings or error messages on allocation failure, so technically they could be removed. It doesn't really give us anything in case of existing code, though, and only makes a potential for merge conflicts, so I'd just leave it alone. Best regards, Tomasz