From patchwork Sat Aug 18 02:33:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiecheng Wu X-Patchwork-Id: 10570439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2963713B4 for ; Mon, 20 Aug 2018 14:34:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1932D2907D for ; Mon, 20 Aug 2018 14:34:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D473291E4; Mon, 20 Aug 2018 14:34:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D234A29178 for ; Mon, 20 Aug 2018 14:34:56 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 952E02676E3; Mon, 20 Aug 2018 15:39:40 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8246F26779C; Sat, 18 Aug 2018 04:33:22 +0200 (CEST) Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by alsa0.perex.cz (Postfix) with ESMTP id 1FF602676C9 for ; Sat, 18 Aug 2018 04:33:17 +0200 (CEST) Received: by mail-pl0-f67.google.com with SMTP id p4-v6so934593pll.8 for ; Fri, 17 Aug 2018 19:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=xacNe41LAk0K8V7wP57eqayD1H5f6bIKvZPh8YC07WY=; b=mUu/9R++t+vyGRG9Dw7P7qpnl6yEaxBEfhmYtxVsp4DeJF/ggh7Vfwxy4vVXbdVyBD Khj/Yo3uMiZ95C0ioNrKButXLL398vkJLNui8Y65bihP5SoGoKWyeUhiHX2vOXfS/94+ h4VJEombsddA/kP3bVN2qHPILbbVsEVcZuPTWoNYbipJy81EKRQJTHycKl9glDs0ZXwd /5GuaansOIWWTlc/0Jxmf4PC5gScL2SW7zF8/1j5ArR6Thbq4ohb79tvgEJv+3Y1Lxjw qYRo/UK9VgUXg8/wdAeCPJbOciKDlzK2R/5jew4fHpl1cO01fdZj1XMdNVmCtK2DVsWt +t4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=xacNe41LAk0K8V7wP57eqayD1H5f6bIKvZPh8YC07WY=; b=gMx+5NxoO8UQgx73Ps1en4LZEkkPT3sQ+Stvie/CajmM1q+i5SwRzf3nNx9eW1hBhb sig3q0UPnO1otefSQrA8V6apMFFWYnqU32fZytRDSx9a1C/hLDZ7cZA0mAOR3sKdaQp5 G9I2e0qCSzzugNzW3tMHqHfsqjuqymAn+QhgwT9j05pEv7UK9vGZ0k5Mwv4Fit9bL/vp uhxdHWMeTBowaexeHU9nv6wNgLnMYXiVireahyPg9d8wlSa4mbg9cneSh23YqhvoWC9F lbLInWC1eaUGgPoV3na05z5EIVsiuIwq4WzxC9WVi5aqxY0cTnOPRHmjO/If76oea0fG PEyw== X-Gm-Message-State: AOUpUlGq6Su1a83HipXTbfwzX4AHJxZKtPOXR7VBccMkp2bmMn743jSe GxTLUJMnBPXXpIh1sifh5G9Q4qgEwb8j0Q== X-Google-Smtp-Source: AA+uWPy8MFE6OhAnZxJbObHEa4wPS+GAZ5P5bvHGwhRC6wTDVhtThVpo4A6I5CwvbDzz/YZkimMYRg== X-Received: by 2002:a17:902:4d45:: with SMTP id o5-v6mr2865576plh.78.1534559595800; Fri, 17 Aug 2018 19:33:15 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:1501:200:5efe:a66f:53fa]) by smtp.gmail.com with ESMTPSA id c88-v6sm4513787pfe.132.2018.08.17.19.33.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Aug 2018 19:33:15 -0700 (PDT) From: Jiecheng Wu To: alsa-devel@alsa-project.org Date: Sat, 18 Aug 2018 10:33:06 +0800 Message-Id: <20180818023306.6824-1-jasonwood2031@gmail.com> X-Mailer: git-send-email 2.14.3.windows.1 X-Mailman-Approved-At: Mon, 20 Aug 2018 15:39:36 +0200 Subject: [alsa-devel] [PATCH] sound/core.c: fix wrong return code of rsnd_probe() when devm_kzalloc() fails X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Function rsnd_probe() defined in sound/soc/sh/rcar/core.c calls devm_kzalloc(). As devm_kzalloc() may return NULL when OOM happens, the caller should return -ENOMEM when devm_kzalloc() fails. --- sound/soc/sh/rcar/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index f8425d8..fd92906 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1502,7 +1502,7 @@ static int rsnd_probe(struct platform_device *pdev) */ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) - return -ENODEV; + return -ENOMEM; priv->pdev = pdev; priv->flags = (unsigned long)of_device_get_match_data(dev);