From patchwork Wed Mar 7 18:06:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 10264651 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 A500C602BD for ; Wed, 7 Mar 2018 18:06:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94CCA29662 for ; Wed, 7 Mar 2018 18:06:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8975329665; Wed, 7 Mar 2018 18:06:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Flag: YES X-Spam-Level: ** X-Spam-Status: Yes, score=2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 X-Spam-Report: * 3.3 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS * [103.46.193.14 listed in zen.spamhaus.org] * 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server * [103.46.193.14 listed in dnsbl.sorbs.net] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (himanshujha199640[at]gmail.com) * 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is * CUSTOM_MED * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2F18729662 for ; Wed, 7 Mar 2018 18:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=u1UdVCKZuhKPthmZ9LIZDLOTaM5muukHfsO8ihD8nAg=; b=niR ajBijcCqQTUCqjpMlKigs/Rrmqkv9ySmXXurf36RFMsXXpDzEksD4faR6D+vTqaeYnfibmRha/9e2 wd0R7CK9vyiXHddou3G8xd9cYAIf9fx0Be5T+4/4yqVStx2XifF8baXCxsColk7zWmBHdMEAkAeVd V8WGN/8smDh4FEX9L56o/z5/WvEj+8Jr3GH2b3GAIU4k+/Q6xegNTFlg+13vbt/z1jh91mDfPledx jO/RUptMhbzWm5A6wWef+Iv3KYTroFxxOUF5rOrwFILEHeks7KAFVq2ddq/IZzUEZxUbhQJp+kKXs RNL/tB21yLVmrNqKsX5hFylMKUC4leQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1etdSN-0005NE-3j; Wed, 07 Mar 2018 18:06:27 +0000 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etdSJ-0005M2-6R for linux-arm-kernel@lists.infradead.org; Wed, 07 Mar 2018 18:06:24 +0000 Received: by mail-pl0-x243.google.com with SMTP id w12-v6so1772812plp.4 for ; Wed, 07 Mar 2018 10:06:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=El8pBhhheLmN45HiUQwP5kBCF854ie5LhIgd3cZ6n58=; b=YrkXcOU6K7wqR/d3wA/fqv9/mRyMCTJ29lozep7gyc4d5iPBXBali9g5yOF3ozSqIr rrMag1Fv6IJBh1FEaZDZEJLcyA0mXK77TfVESPE07n6+1AK2W1GCxAtbmlxuUeyOkM02 7HWxLJG0cN9Q09j9iQJZwNDTVJAdtfADYcDW6etojdfjx//7OWQ6+tsIFW6es7klM44i UgUPR3uza06grnPVY4etxxDdMWbEcpVR/ukQNo8RSS0zs+/PDwJg04YSeaDQJIwDVkAa kK6/Ib+TG2cygx7eIcX2KBJhnWTD8Kfnm0vWt7GWVxwEfabO4FOsuXzrbjoOULUFJH38 Q0Jw== 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=El8pBhhheLmN45HiUQwP5kBCF854ie5LhIgd3cZ6n58=; b=n/6EsYSGkMCCl0az9ZRCf3qQgl7MJcm0jbWaLLDKyhD4jZJg6KLdXKnS0/mqkPUOa3 ZbBaekbOS5Y3Z71F4flrQyp58f7fIRbQMaC0McLkehLJ3OjU8WbCDP/pt+Fi8ViaxCjl rotT2YSuw3LyMVD3vhnFMJfBedtnTyZ9tQ7SRXabOPbZ7nyyEIBARHWupSwQzrKmotqC 0u+as1khFvfRuBmc0+AtvLNtf03osepdrD4UDDxQYl90JH+uKBsA4xTe1I3pE2Qeztk9 GSM6jEIYx/Q+xUfnEeR++Buo1dBord4PAjB/bcP/Dnq2FjayGD6wnLsbEjPkMPw49/BK LjoA== X-Gm-Message-State: AElRT7GQjOZsAhuTwqj9jB0J/3CHqwaB4ba/jR/Y6TH6OG8y3jNqcsnB 8Ztx3tI0XbMiA7CFhzWFb1U= X-Google-Smtp-Source: AG47ELu2LtfrFQ4tIdV5BJ/tN+9zSskISnEpxACscRIKZFYinRnbJKIIApdAP3lLVNWnZeDBXys2uQ== X-Received: by 2002:a17:902:8691:: with SMTP id g17-v6mr9337913plo.7.1520445972297; Wed, 07 Mar 2018 10:06:12 -0800 (PST) Received: from localhost.localdomain ([103.46.193.14]) by smtp.gmail.com with ESMTPSA id q81sm19713810pfl.188.2018.03.07.10.06.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Mar 2018 10:06:11 -0800 (PST) From: Himanshu Jha To: linus.walleij@linaro.org Subject: [PATCH] mfd: ab8500-debugfs: Use kasprintf Date: Wed, 7 Mar 2018 23:36:01 +0530 Message-Id: <1520445961-12160-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180307_100623_290822_2714479E X-CRM114-Status: GOOD ( 10.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lee.jones@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Himanshu Jha MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use kasprintf instead of combination of kmalloc and sprintf. Signed-off-by: Himanshu Jha --- drivers/mfd/ab8500-debugfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index 8ba4107..831a1ce 100644 --- a/drivers/mfd/ab8500-debugfs.c +++ b/drivers/mfd/ab8500-debugfs.c @@ -2519,11 +2519,10 @@ static ssize_t ab8500_subscribe_write(struct file *file, if (!dev_attr[irq_index]) return -ENOMEM; - event_name[irq_index] = kmalloc(count, GFP_KERNEL); + event_name[irq_index] = kasprintf(GFP_KERNEL, "%lu", user_val); if (!event_name[irq_index]) return -ENOMEM; - sprintf(event_name[irq_index], "%lu", user_val); dev_attr[irq_index]->show = show_irq; dev_attr[irq_index]->store = NULL; dev_attr[irq_index]->attr.name = event_name[irq_index];