From patchwork Sat Sep 17 19:43:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 9337351 X-Patchwork-Delegate: kvalo@adurom.com 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 7612460839 for ; Sat, 17 Sep 2016 19:43:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67E96291CE for ; Sat, 17 Sep 2016 19:43:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C846291E5; Sat, 17 Sep 2016 19:43:32 +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 0557F291DC for ; Sat, 17 Sep 2016 19:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753581AbcIQTnT (ORCPT ); Sat, 17 Sep 2016 15:43:19 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35346 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131AbcIQTnK (ORCPT ); Sat, 17 Sep 2016 15:43:10 -0400 Received: by mail-wm0-f66.google.com with SMTP id 133so8680929wmq.2; Sat, 17 Sep 2016 12:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=YgCa85VuO9NPpcni5Q4vewgS7xQOc6FhSAkfCC2KLGc=; b=rj2QYBv8sjJCn3xqvxn86wFzBiUVbIMKFCeD2MKrnJ6d5HVQp48rjp3FZcFaX+TYqa ohCI3zU0VGIKkxldfXtOuuYID5mlcKX9ku0bwc8HdqNBl5FagnpDgo0wDVmsREIdZNWf 2h4nNZfjVPCyi22+Z0qcDwAtgdJXTU5CueXI5howdLLr8esXwmVQtm3TbDnpHASJMKc/ fvFPmSmB22tcFVyyj5YivVQ6z5gjf5qgawjm0eSH3kAsQAe98g9Xdixb0c7lkFjOWnbU rwEN/si7nOWZ4oKJdgW9JdJ+Vh2KamXgVcSgTy20AOmc7PRZQYbt9MDB3fmYk82ypb7m Xnzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=YgCa85VuO9NPpcni5Q4vewgS7xQOc6FhSAkfCC2KLGc=; b=OSdv7SyFijZO8AFKRq5bfo02qfIeTBPDSg2Pbxd+m2xjMmFlLOjRr6XFKJVpN9sOgt nznn0Bj15bjehCcP51Iou3apOYlW8y7Ex2ZuMbgRcqv6eBPz1d4ekmHA1B98bfGBUDPt is7vKq0s81RFkhFGNu6gPqR7aiMz8YOGAqHmnIVVXd1XfcKRgGp2+xTisE7+wPC6Lsf/ 4EMX14pwsrJwrREt3avn17uoFnRla9qHH0xOOy8SQ+/3Ok5H0Gt+q8LighywEdV0R6EX FZUNneWnJ7zUW6H5PU1MN8I/9kovD7RXswaYWeXGKPGaYFroF5Xc+r5l4Fl0BX0xdLoW qXiQ== X-Gm-Message-State: AE9vXwMEB48GLPA0V9thYHYp1O7j3Uu3WAflOmqgMAQV1OxudUh/pfPbGZgVGLocToIvtA== X-Received: by 10.28.51.146 with SMTP id z140mr2805037wmz.9.1474141389070; Sat, 17 Sep 2016 12:43:09 -0700 (PDT) Received: from debian64.daheim (pD9F8BE97.dip0.t-ipconnect.de. [217.248.190.151]) by smtp.gmail.com with ESMTPSA id w129sm13496918wmd.9.2016.09.17.12.43.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Sep 2016 12:43:08 -0700 (PDT) From: Christian Lamparter X-Google-Original-From: Christian Lamparter Received: from chuck by debian64.daheim with local (Exim 4.87) (envelope-from ) id 1blLVz-0006sx-NN; Sat, 17 Sep 2016 21:43:07 +0200 To: gregkh@linuxfoundation.org, Kalle Valo Cc: Christian Lamparter , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, Nicolai Stange , Ben Greear , Larry Finger Subject: [PATCH 4/4] b43legacy: fix debugfs crash Date: Sat, 17 Sep 2016 21:43:04 +0200 Message-Id: <720ed4bfe5eef248727fa4af63975a0612b7e0e4.1474140477.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <48411543620969bebb37a1a9ea7b8f451cdfdd31.1474140477.git.chunkeey@gmail.com> References: <48411543620969bebb37a1a9ea7b8f451cdfdd31.1474140477.git.chunkeey@gmail.com> In-Reply-To: <60f368dd08cafebc3d39de18996d1df85f525887.1474140477.git.chunkeey@gmail.com> References: <48411543620969bebb37a1a9ea7b8f451cdfdd31.1474140477.git.chunkeey@gmail.com> <60f368dd08cafebc3d39de18996d1df85f525887.1474140477.git.chunkeey@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes a crash that happens because b43legacy's debugfs code expects file->f_op to be a pointer to its own b43legacy_debugfs_fops struct. This is no longer the case since commit 9fd4dcece43a ("debugfs: prevent access to possibly dead file_operations at file open") Reviewed-by: Nicolai Stange Signed-off-by: Christian Lamparter --- drivers/net/wireless/broadcom/b43legacy/debugfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/b43legacy/debugfs.c b/drivers/net/wireless/broadcom/b43legacy/debugfs.c index 090910e..82ef56e 100644 --- a/drivers/net/wireless/broadcom/b43legacy/debugfs.c +++ b/drivers/net/wireless/broadcom/b43legacy/debugfs.c @@ -221,7 +221,8 @@ static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf, goto out_unlock; } - dfops = container_of(file->f_op, struct b43legacy_debugfs_fops, fops); + dfops = container_of(debugfs_real_fops(file), + struct b43legacy_debugfs_fops, fops); if (!dfops->read) { err = -ENOSYS; goto out_unlock; @@ -287,7 +288,8 @@ static ssize_t b43legacy_debugfs_write(struct file *file, goto out_unlock; } - dfops = container_of(file->f_op, struct b43legacy_debugfs_fops, fops); + dfops = container_of(debugfs_real_fops(file), + struct b43legacy_debugfs_fops, fops); if (!dfops->write) { err = -ENOSYS; goto out_unlock;