* [patch] Extcon: check for allocation failure
@ 2012-04-25 8:47 Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2012-04-25 8:47 UTC (permalink / raw)
To: MyungJoo Ham
Cc: Greg Kroah-Hartman, Kyungmin Park, Mark Brown, Donggeun Kim,
linux-kernel, kernel-janitors
Return -ENOMEM if the kmalloc() fails.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c
index 3bc4b8a..fe5a038 100644
--- a/drivers/extcon/extcon_class.c
+++ b/drivers/extcon/extcon_class.c
@@ -621,6 +621,8 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
}
edev->dev = kzalloc(sizeof(struct device), GFP_KERNEL);
+ if (!edev->dev)
+ return -ENOMEM;
edev->dev->parent = dev;
edev->dev->class = extcon_class;
edev->dev->release = extcon_dev_release;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] Extcon: check for allocation failure
@ 2012-04-25 8:53 MyungJoo Ham
0 siblings, 0 replies; 2+ messages in thread
From: MyungJoo Ham @ 2012-04-25 8:53 UTC (permalink / raw)
To: Dan Carpenter
Cc: Greg Kroah-Hartman, 박경민, Mark Brown,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
최찬우
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 822 bytes --]
> Return -ENOMEM if the kmalloc() fails.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
>
> diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c
> index 3bc4b8a..fe5a038 100644
> --- a/drivers/extcon/extcon_class.c
> +++ b/drivers/extcon/extcon_class.c
> @@ -621,6 +621,8 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
> }
>
> edev->dev = kzalloc(sizeof(struct device), GFP_KERNEL);
> + if (!edev->dev)
> + return -ENOMEM;
> edev->dev->parent = dev;
> edev->dev->class = extcon_class;
> edev->dev->release = extcon_dev_release;
>
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-25 8:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-25 8:53 [patch] Extcon: check for allocation failure MyungJoo Ham
-- strict thread matches above, loose matches on Subject: below --
2012-04-25 8:47 Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox