From patchwork Thu Jan 31 13:15:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10790495 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 196C9922 for ; Thu, 31 Jan 2019 13:16:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B5BD30B81 for ; Thu, 31 Jan 2019 13:16:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 095D230D66; Thu, 31 Jan 2019 13:16:09 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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 A1F9330B81 for ; Thu, 31 Jan 2019 13:16:08 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date: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=p0xVMHa3kYwc+yYHd2VMpYNOA/StI+9cq3OVarZ+xAg=; b=QEq54dXSOe15i4 dO5KzlVT6d+T+kuj3mhBZJadv3Lzq/OG4imLVnrH084wCeq0lTCCIzCCA2mt+pW7cGfT8d2eNRoTw rymku6CdJakCKpN/NGJzxTU5KQzktgLSMEXu5gt3sZdXIGUPscnupLxDBlYA9LnYXOXEBjvH11a+c 8L1kOV+l/hypiNR9fdpVov8elySDbnB+U1nmLxowkxhr02BFTwCO9R+xXBwrIgtjGTWqo+43xohxb ajvj3QAb9BjrUKmwOpCrIWJpj/QdXk+Ln3kgKAAItwNHewgjmqtbEE8fj0vgGeQ94cqlpb9M7SiOb TNjE5SAHA/c4y/NoVM6g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpCCL-0002NH-U5; Thu, 31 Jan 2019 13:16:05 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpCCF-0002Jg-9M for ath10k@lists.infradead.org; Thu, 31 Jan 2019 13:16:03 +0000 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 417BD218D3; Thu, 31 Jan 2019 13:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548940558; bh=12Ixcgdd5ByPPgRPrckh93UFXuKJB2u8/hJZjGNZ550=; h=Date:From:To:Cc:Subject:From; b=M5CgFxQsnyBb1Av2vuPXA5fWs+bv94X0RVyRC9ogd0qc1sXDfoMJlSpM5ROBHUDqG dXiBtHM1PTq9gmQAQb/K88bU1wCI/LtfxI8+Lb2BkXs69f8w54+6Cywd6MO6FfPtAP GZ7DDc3p6qWzEgSNmqMM1ek6RPKqwb/bhXZ1USI4= Date: Thu, 31 Jan 2019 14:15:56 +0100 From: Greg Kroah-Hartman To: Kalle Valo Subject: [PATCH] ath10k: do not return invalid pointers as a *dentry Message-ID: <20190131131556.GB19807@kroah.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.2 (2019-01-07) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190131_051559_501507_EB18A6CB X-CRM114-Status: UNSURE ( 9.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When calling debugfs functions, they can now return error values if something went wrong. If that happens, return a NULL as a *dentry to the relay core instead of passing it an illegal pointer. The relay core should be able to handle an illegal pointer, but add this check to be safe. Cc: Kalle Valo Cc: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath10k/spectral.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/spectral.c b/drivers/net/wireless/ath/ath10k/spectral.c index 653b6d013207..4a7fa3e4e99f 100644 --- a/drivers/net/wireless/ath/ath10k/spectral.c +++ b/drivers/net/wireless/ath/ath10k/spectral.c @@ -494,6 +494,9 @@ static struct dentry *create_buf_file_handler(const char *filename, buf_file = debugfs_create_file(filename, mode, parent, buf, &relay_file_operations); + if (IS_ERR(buf_file)) + return NULL; + *is_global = 1; return buf_file; }