From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/22] dm: i2c: Add a missing memory allocaton check
Date: Thu, 19 Feb 2015 08:41:47 +0100 [thread overview]
Message-ID: <54E593BB.20106@denx.de> (raw)
In-Reply-To: <1424293849-22193-2-git-send-email-sjg@chromium.org>
Hello Simon,
Am 18.02.2015 22:10, schrieb Simon Glass:
> This strdup() is missing a check. Add it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> drivers/i2c/i2c-uclass.c | 2 ++
> 1 file changed, 2 insertions(+)
Good catch, Thanks!
Acked-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c
> index a6991bf..b890806 100644
> --- a/drivers/i2c/i2c-uclass.c
> +++ b/drivers/i2c/i2c-uclass.c
> @@ -230,6 +230,8 @@ static int i2c_bind_driver(struct udevice *bus, uint chip_addr, uint offset_len,
>
> snprintf(name, sizeof(name), "generic_%x", chip_addr);
> str = strdup(name);
> + if (!str)
> + return -ENOMEM;
> ret = device_bind_driver(bus, "i2c_generic_chip_drv", str, &dev);
> debug("%s: device_bind_driver: ret=%d\n", __func__, ret);
> if (ret)
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2015-02-19 7:41 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-18 21:10 [U-Boot] [PATCH 0/22] Add driver model support for PCI Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 01/22] dm: i2c: Add a missing memory allocaton check Simon Glass
2015-02-19 7:41 ` Heiko Schocher [this message]
2015-03-05 4:09 ` Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 02/22] sandbox: Correct device tree 'reg' properties for I2C and SPI Simon Glass
2015-02-25 8:20 ` Bin Meng
2015-03-05 4:09 ` Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 03/22] fdt: Export fdtdec_get_number() for general use Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 04/22] x86: Add a x86_ prefix to the x86-specific PCI functions Simon Glass
2015-02-25 8:32 ` Bin Meng
2015-02-18 21:10 ` [U-Boot] [PATCH 05/22] RFC: x86: Split up arch_cpu_init() Simon Glass
2015-02-25 8:45 ` Bin Meng
2015-02-26 0:55 ` Simon Glass
2015-02-26 7:15 ` Bin Meng
2015-03-05 4:10 ` Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 06/22] Correct map_sysmem() logic in do_mem_mw() Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 07/22] fdt: Tighten up error handling in fdtdec_get_pci_addr() Simon Glass
2015-02-25 9:29 ` Bin Meng
2015-03-05 4:10 ` Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 08/22] dm: core: Add dev_get_uclass_priv() to access uclass private data Simon Glass
2015-02-26 7:26 ` Bin Meng
2015-03-05 4:10 ` Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 09/22] dm: core: Mark device as active before calling its probe() method Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 10/22] dm: core: Add a uclass pre_probe() method for devices Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 11/22] dm: Show both allocated and requested seq numbers in 'dm uclass' Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 12/22] dm: pci: Move common PCI functions into their own file Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 13/22] dm: pci: Add a uclass for PCI Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 14/22] dm: sandbox: pci: Add PCI support for sandbox Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 15/22] dm: sandbox: Add a simple PCI driver Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 16/22] dm: sandbox: pci: Add a PCI emulation uclass Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 17/22] dm: sandbox: Add a emulated PCI device as an example Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 18/22] dm: sandbox: pci: Enable PCI for sandbox Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 19/22] dm: x86: pci: Add a PCI driver for driver model Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 20/22] dm: x86: pci: Convert coreboot to use driver model for pci Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 21/22] dm: x86: pci: Convert chromebook_link " Simon Glass
2015-02-18 21:10 ` [U-Boot] [PATCH 22/22] dm: pci: Add driver model tests for PCI Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54E593BB.20106@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.