Message ID | 20131105202007.GB3949@elgon.mountain (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Tuesday, November 05, 2013 11:20:07 PM Dan Carpenter wrote: > We dereference extlog_l1_addr so the check is too late. The > "extlog_l1_addr" pointer can never be NULL when this function is called > so I have removed the check. > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> I'm wondering what kernel you have checked, because drivers/acpi/acpi_extlog.c is not present in the mainline or even in linux-next? Rafael > > diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c > index c4d5e59..d59e4bb 100644 > --- a/drivers/acpi/acpi_extlog.c > +++ b/drivers/acpi/acpi_extlog.c > @@ -308,8 +308,7 @@ static void __exit extlog_exit(void) > { > mce_unregister_decode_chain(&extlog_mce_dec); > ((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN; > - if (extlog_l1_addr) > - acpi_os_unmap_memory(extlog_l1_addr, l1_size); > + acpi_os_unmap_memory(extlog_l1_addr, l1_size); > if (elog_addr) > acpi_os_unmap_memory(elog_addr, elog_size); > release_mem_region(elog_base, elog_size); > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Nov 6, 2013 at 2:06 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > I'm wondering what kernel you have checked, because drivers/acpi/acpi_extlog.c > is not present in the mainline or even in linux-next? It's in the "tip" tree ... and seems to be in next-20131106 -Tony -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wednesday, November 06, 2013 02:45:18 PM Tony Luck wrote: > On Wed, Nov 6, 2013 at 2:06 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > > I'm wondering what kernel you have checked, because drivers/acpi/acpi_extlog.c > > is not present in the mainline or even in linux-next? > > It's in the "tip" tree ... and seems to be in next-20131106 Well, OK. Who's going to maintain this file? Rafael -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Nov 07, 2013 at 01:09:38AM +0100, Rafael J. Wysocki wrote: > Date: Thu, 07 Nov 2013 01:09:38 +0100 > From: "Rafael J. Wysocki" <rjw@rjwysocki.net> > To: Tony Luck <tony.luck@gmail.com> > Cc: Dan Carpenter <dan.carpenter@oracle.com>, Len Brown <lenb@kernel.org>, > Gong <gong.chen@linux.intel.com>, linux-acpi <linux-acpi@vger.kernel.org>, > kernel-janitors@vger.kernel.org > Subject: Re: [patch 2/2] ACPI, extlog: remove unneeded NULL check > User-Agent: KMail/4.10.5 (Linux/3.12.0-rc6+; KDE/4.10.5; x86_64; ; ) > > On Wednesday, November 06, 2013 02:45:18 PM Tony Luck wrote: > > On Wed, Nov 6, 2013 at 2:06 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > > > I'm wondering what kernel you have checked, because drivers/acpi/acpi_extlog.c > > > is not present in the mainline or even in linux-next? > > > > It's in the "tip" tree ... and seems to be in next-20131106 > > Well, OK. Who's going to maintain this file? > > Rafael > It's me. I will maintain this file. BTW, Dan According to your codes, I think elog_addr check can be removed, too. Can you send out a updated version?
diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index c4d5e59..d59e4bb 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -308,8 +308,7 @@ static void __exit extlog_exit(void) { mce_unregister_decode_chain(&extlog_mce_dec); ((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN; - if (extlog_l1_addr) - acpi_os_unmap_memory(extlog_l1_addr, l1_size); + acpi_os_unmap_memory(extlog_l1_addr, l1_size); if (elog_addr) acpi_os_unmap_memory(elog_addr, elog_size); release_mem_region(elog_base, elog_size);
We dereference extlog_l1_addr so the check is too late. The "extlog_l1_addr" pointer can never be NULL when this function is called so I have removed the check. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html