From patchwork Mon Dec 26 15:36:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9488659 X-Patchwork-Delegate: bhelgaas@google.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 B783B60839 for ; Mon, 26 Dec 2016 15:36:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB8081FF8E for ; Mon, 26 Dec 2016 15:36:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A03571FFC9; Mon, 26 Dec 2016 15:36:52 +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=-3.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=unavailable 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 658F41FF8E for ; Mon, 26 Dec 2016 15:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753077AbcLZPgt (ORCPT ); Mon, 26 Dec 2016 10:36:49 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33958 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbcLZPgs (ORCPT ); Mon, 26 Dec 2016 10:36:48 -0500 Received: by mail-pf0-f193.google.com with SMTP id y68so17066534pfb.1; Mon, 26 Dec 2016 07:36:47 -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=utjti493EQkU1ZuJU9Y2iLqpW0Lx2c+ttkATW+e0Qo0=; b=KtyIdAG655EmUW9IE0fbycSqqCnwHb1jAtyAgPHWSW7zKdXE1WBSYJVWjrPMLpkq2K GjS51dAA/zEIx1hJnLUDiJLPbaEu5apVWZe0U9mPrpwM9GnuLmuginv9w2mkGRKJACWX jljJ14DbL04Q86EvRM4w8m5FZmsC7zdHjvjLG7+oa8e61HPyJPZPBSIA0HlwjRjFIvRT 9jq80I5xNAzz8EgL5C2QBNwXerr4c+IMC9AztXW29ydI7qvRXVw2lEeWeHOokkcv80zD WD4cCAulkZBzscwRYm0mPKNoazV+agNYb7YjiFuGhNwQCtUbRKIFLhEaihDaw+51w8gR FvFg== 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=utjti493EQkU1ZuJU9Y2iLqpW0Lx2c+ttkATW+e0Qo0=; b=iBBbvhS1AGdrjMcBj8S6JrohpNVfASskJMvctI7zBfvrayolE6ewLJ34mPUvXijwev eOWuYAO3Z+58n1fPDdYIP0/rB8owXRuNt/Q+Qe/FCMFdJAeghIyLvUyZJAEfnKD+zt5M wUUCXIgtSa5lYmetfpqH/nHOm4XlL6JTp7nuf9WOESdeWUZLzLvxA4AxcTu6T1SEWUBu fLqqXEKL8Kso3Xe2h+rUsukI94fTrS9dx38hZe+LQbGeLeElkVDZhVM/oh53w+CcPJa1 hLWwevbVBhachLhMJrj1e8uW6JmwOzcsM5bfmxHHsSb+u2+ZQBrCSPbmTfBjcP8IzEEk sCGw== X-Gm-Message-State: AIkVDXI1+O2k+1y4sHdB6ua77eUoxkAQz51wNk/0gI/wpydACjIoHqNWg2TLAwQaqf0oqw== X-Received: by 10.98.35.199 with SMTP id q68mr24396460pfj.176.1482766607333; Mon, 26 Dec 2016 07:36:47 -0800 (PST) Received: from gmail.com ([117.196.102.47]) by smtp.gmail.com with ESMTPSA id o24sm32831569pfj.78.2016.12.26.07.36.41 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 26 Dec 2016 07:36:45 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Mon, 26 Dec 2016 21:06:39 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, rjw@rjwysocki.net, lenb@kernel.org, bhelgaas@google.com, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: keescook@chromium.org, Bhumika Goyal Subject: [PATCH] PCI: acpiphp_ibm: add __ro_after_init to ibm_apci_table_attr Date: Mon, 26 Dec 2016 21:06:35 +0530 Message-Id: <1482766595-12679-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The object ibm_apci_table_attr of type bin_attribute structure is not modified after getting initialized by ibm_acpiphp_init. Apart from getting referenced in init it is also passed as an argument to the functions sysfs_{remove/create}_bin_file but both the arguments are of type const struct bin_attribute *. Therefore add __ro_after_init to its declaration. Signed-off-by: Bhumika Goyal Reviewed-by: Kees Cook --- drivers/pci/hotplug/acpiphp_ibm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c index f6221d7..188cdfa 100644 --- a/drivers/pci/hotplug/acpiphp_ibm.c +++ b/drivers/pci/hotplug/acpiphp_ibm.c @@ -107,7 +107,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, static acpi_handle ibm_acpi_handle; static struct notification ibm_note; -static struct bin_attribute ibm_apci_table_attr = { +static struct bin_attribute ibm_apci_table_attr __ro_after_init = { .attr = { .name = "apci_table", .mode = S_IRUGO,