From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH] i2c-imx: Use xzalloc instead of kzalloc
Date: Sun, 8 Nov 2015 16:18:47 -0800 [thread overview]
Message-ID: <1447028327-20277-2-git-send-email-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <1447028327-20277-1-git-send-email-andrew.smirnov@gmail.com>
Driver's private data structure is allocated with kzalloc without any
code to check for kzalloc's possible failure. Fix that by replaceing
kzalloc with xzalloc.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
drivers/i2c/busses/i2c-imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 7df4a26..47a50db 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -590,7 +590,7 @@ static int __init i2c_fsl_probe(struct device_d *pdev)
pdata = pdev->platform_data;
- i2c_fsl = kzalloc(sizeof(struct fsl_i2c_struct), GFP_KERNEL);
+ i2c_fsl = xzalloc(sizeof(struct fsl_i2c_struct), GFP_KERNEL);
#ifdef CONFIG_COMMON_CLK
i2c_fsl->clk = clk_get(pdev, NULL);
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-11-09 0:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 0:18 [PATCH v2] i2c: Add support for DesignWare controllers Andrey Smirnov
2015-11-09 0:18 ` Andrey Smirnov [this message]
2015-11-09 6:20 ` Sascha Hauer
2015-11-19 1:26 ` Trent Piepho
2015-11-19 4:09 ` Andrey Smirnov
2015-11-19 7:59 ` Sascha Hauer
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=1447028327-20277-2-git-send-email-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=barebox@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox