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
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAAP30F1gWgvPwO2VT8fcP7X8veJuMfFjg34LkRaz-q7mwGfWg@mail.gmail.com>
Date:	Thu, 21 Jun 2012 08:55:43 -0300
From:	Alexandre Pereira da Silva <aletes.xgr@...il.com>
To:	Ivo Sieben <meltedpianoman@...il.com>
Cc:	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Rob Landley <rob@...dley.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Wolfram Sang <w.sang@...gutronix.de>,
	Chris Wright <chrisw@...s-sol.org>,
	devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, Roland Stigge <stigge@...com.de>
Subject: Re: [PATCH] SPI: at25: Parse dt settings

On Thu, Jun 21, 2012 at 8:10 AM, Alexandre Pereira da Silva
<aletes.xgr@...il.com> wrote:
> On Thu, Jun 21, 2012 at 6:49 AM, Ivo Sieben <meltedpianoman@...il.com> wrote:
>> One small remark:
>> In case of platform_data, the "if (!chip)" check has been removed and
>> is now only handled in the device tree initialization.
>> Maybe add this check to the platform initialization as well:
>>
>> } else {
>>        if (!spi->dev.platform_data) {
>>                dev_dbg(&spi->dev, "no chip description\n");
>>                err = -ENODEV;
>>                goto fail;
>>        }
>>        chip =  *(struct spi_eeprom *)spi->dev.platform_data;
>> }

Please ignore my last email. Not enough coffee.

I'm sorry. The code looks right to me.

-       chip = spi->dev.platform_data;
-       if (!chip) {
-               dev_dbg(&spi->dev, "no chip description\n");
-               err = -ENODEV;
-               goto fail;
-       }
+       if (!spi->dev.platform_data) {
+               if (np) {
                             /* No platform data and DT node present,
DT handling */
+               } else {
                            /* No DT and No platform description,
handle error */
+                       dev_dbg(&spi->dev, "no chip description\n");
+                       err = -ENODEV;
+                       goto fail;
+               }
+       } else
                 /* At this point chip is guaranteed to have valid data */
+               chip = *(struct spi_eeprom *)spi->dev.platform_data;
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ