From patchwork Wed Sep 20 06:59:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9960969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B609E600C5 for ; Wed, 20 Sep 2017 07:00:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8DBE2846D for ; Wed, 20 Sep 2017 07:00:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D18628FDA; Wed, 20 Sep 2017 07:00:24 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DC2B2846D for ; Wed, 20 Sep 2017 07:00:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751589AbdITHAM (ORCPT ); Wed, 20 Sep 2017 03:00:12 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:38515 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbdITHAL (ORCPT ); Wed, 20 Sep 2017 03:00:11 -0400 Received: by mail-pg0-f66.google.com with SMTP id m30so1164645pgn.5; Wed, 20 Sep 2017 00:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=SATDT1SqPyZzIaBXrO95LDz6h9GC3w8KNkfXJqqDxqU=; b=n+3ryKiy96puPS0cCGVAF7B0G0vGWG3+aIU3r+0LO9t26VfcWoaDM9Ik3oFhwl+U8Q OHa7vBi9xP6SAWYWr5LjtClc7WCH2D6zRVKtqjXynzF9agXoWQdPNKA2QnhubwyV++uC zywba30rhnXD0uz/Bp0RwyZf9jCrD6raa9NRmQiIPIqDQRf9Gd3M7QbehnS8mvG5sJnl x7dGPHgklirprJNu77tj0DxU8uIgaIoq7mNd8ArkVPWFlbUiy3cv3NIYBT7C/sACe7ah ytAbnA4NQdsLjFFjyUbCWjuMkYU4wbPvV/dWKYoM9XEE+QvzyGRAYgGOvTt5QYuepwrP gFzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SATDT1SqPyZzIaBXrO95LDz6h9GC3w8KNkfXJqqDxqU=; b=TFxt0/RicFXjq64HZw7rCiBXtWU6MC7VGTaC/4KqHoXLq0Imi67MUhVT8FeB/IXceF 8TDX80bjythnT9rFL1cis8GBEvxt0nPkdnVH6x4nEyuvw/PK/BbEgLRmkcwkbYOPhWNc LQtMSBU6XHuKwIj8k3Da9C7g4Qm4i9l+aREsQ6sHP12ytT6eqMfkCbzGeogYzI4D7bXi gp7hlKY6Ldetytxd4512l1tJr1WS/bOHrlSHuMSDre7UPWQVIP5tQPZMWmFxAt2eKrD2 327WP7ntauOCEt3gmpXN94PbMDWOmIy9bPf3CsHfUcMfXOyMX1VBwK3iesSP5ypARcgi E08w== X-Gm-Message-State: AHPjjUh95YCJ4d8zMeQpmenZheuhzLmLSSDckMRt13I3SutbOsxTduHr FweUIksYmNp3YJIv/j0P2IA= X-Google-Smtp-Source: AOwi7QA5lNRLniBNCGlgGJbI+8MrKcl9EscQgR+h92QiZx7h7/b4TDarIHuolHDbYdVmgB6MUBw37Q== X-Received: by 10.99.102.1 with SMTP id a1mr1176126pgc.431.1505890811212; Wed, 20 Sep 2017 00:00:11 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id d186sm6209746pfa.97.2017.09.20.00.00.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 00:00:10 -0700 (PDT) From: Arvind Yadav To: vireshk@kernel.org, nm@ti.com, sboyd@codeaurora.org, rjw@rjwysocki.net, pavel@ucw.cz, len.brown@intel.com, gregkh@linuxfoundation.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM / OPP: Handle return value of kasprintf Date: Wed, 20 Sep 2017 12:29:13 +0530 Message-Id: <15cec6eac63ffc9f12f1d16aff913eccad670f77.1505817563.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- drivers/base/power/opp/debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/opp/debugfs.c b/drivers/base/power/opp/debugfs.c index 81cf120..226d6ae 100644 --- a/drivers/base/power/opp/debugfs.c +++ b/drivers/base/power/opp/debugfs.c @@ -45,7 +45,8 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp, for (i = 0; i < opp_table->regulator_count; i++) { name = kasprintf(GFP_KERNEL, "supply-%d", i); - + if (!name) + return false; /* Create per-opp directory */ d = debugfs_create_dir(name, pdentry);