Message ID | 1451425126-26958-1-git-send-email-wuninsu@gmail.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: Insu Yun <wuninsu@gmail.com> Date: Tue, 29 Dec 2015 16:38:46 -0500 > Since kzalloc can be failed in memory pressure, > NULL dereference might be happened. > > Signed-off-by: Insu Yun <wuninsu@gmail.com> Sorry, this is not a correct fix. You need to propagate an error back to the callers, and they must act upon that error. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c index 114f3bc..15164e9 100644 --- a/drivers/isdn/hardware/mISDN/hfcsusb.c +++ b/drivers/isdn/hardware/mISDN/hfcsusb.c @@ -264,6 +264,9 @@ hfcsusb_ph_info(struct hfcsusb *hw) phi = kzalloc(sizeof(struct ph_info) + dch->dev.nrbchan * sizeof(struct ph_info_ch), GFP_ATOMIC); + if (!phi) + return; + phi->dch.ch.protocol = hw->protocol; phi->dch.ch.Flags = dch->Flags; phi->dch.state = dch->state;
Since kzalloc can be failed in memory pressure, NULL dereference might be happened. Signed-off-by: Insu Yun <wuninsu@gmail.com> --- drivers/isdn/hardware/mISDN/hfcsusb.c | 3 +++ 1 file changed, 3 insertions(+)