lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 24 Sep 2014 11:48:01 -0600 From: Bjorn Helgaas <bhelgaas@...gle.com> To: Quentin Lambert <lambert.quentin@...il.com> Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>, Len Brown <lenb@...nel.org>, Scott Murray <scott@...teful.org>, linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH v2 4/4] PCI: remove assignement in non straight forward if condition On Sun, Sep 07, 2014 at 08:04:28PM +0200, Quentin Lambert wrote: > The modifications effectively change the value of len_tmp > in the case where the first condition is not met. > > Signed-off-by: Quentin Lambert <lambert.quentin@...il.com> > --- > drivers/pci/hotplug/ibmphp_res.c | 13 +++++++++---- > drivers/pci/pci.c | 6 +++++- > drivers/pci/slot.c | 12 ++++++++++-- > 3 files changed, 24 insertions(+), 7 deletions(-) > ... > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index 8b63a5b..4c3ef21 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -4434,9 +4434,13 @@ static int __init pci_setup(char *str) > { > while (str) { > char *k = strchr(str, ','); > + char tmp = *str; > + > if (k) > *k++ = 0; > - if (*str && (str = pcibios_setup(str)) && *str) { > + > + str = pcibios_setup(str); > + if (tmp && str && *str) { I dropped this change because I don't think the replacement is quite equivalent. Previously, we only called pcibios_setup() if "*str". The new code calls it even if "!*str". > if (!strcmp(str, "nomsi")) { > pci_no_msi(); > } else if (!strcmp(str, "noaer")) { > diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c > index 396c200..22d20db 100644 > --- a/drivers/pci/slot.c > +++ b/drivers/pci/slot.c > @@ -265,8 +265,16 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, > slot = get_slot(parent, slot_nr); > if (slot) { > if (hotplug) { > - if ((err = slot->hotplug ? -EBUSY : 0) > - || (err = rename_slot(slot, name))) { > + err = slot->hotplug ? -EBUSY : 0; > + if (err) > + goto hotplugerror; > + > + err = rename_slot(slot, name); > + if (err) > + goto hotplugerror; > + > + if (0) { > +hotplugerror: > kobject_put(&slot->kobj); > slot = NULL; > goto err; And I dropped this one because the code is too ugly. Granted, the original is probably even uglier, but if we're going to change it, I'm going to hold out for a prettier restructuring. Bjorn -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists