From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH net-next 3/6] net: hip04: Solve the problem of the skb memory allocation failure Date: Wed, 15 Apr 2015 16:17:31 +0200 Message-ID: <2443005.XhuHWvJbTU@wuerfel> References: <1429101008-9464-1-git-send-email-dingtianhong@huawei.com> <1429101008-9464-4-git-send-email-dingtianhong@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org To: Ding Tianhong Return-path: In-Reply-To: <1429101008-9464-4-git-send-email-dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Wednesday 15 April 2015 20:30:05 Ding Tianhong wrote: > The driver will alloc some skb buffer for hareware queue, but without > considering the case of memory allocation failure, when memory is low, > the skb may be null and panic the system, so break the loop when skb is > null and try to alloc the memory again to fix this problem. > > Signed-off-by: Ding Tianhong > Cc: "David S. Miller" > Cc: Eric Dumazet > Cc: Arnd Bergmann > Cc: Zhangfei Gao > Cc: Dan Carpenter > Cc: Joe Perches > Looks reasonable to me, though I haven't done a deep analysis to see if there are remaining problems in this area. Arnd -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Wed, 15 Apr 2015 16:17:31 +0200 Subject: [PATCH net-next 3/6] net: hip04: Solve the problem of the skb memory allocation failure In-Reply-To: <1429101008-9464-4-git-send-email-dingtianhong@huawei.com> References: <1429101008-9464-1-git-send-email-dingtianhong@huawei.com> <1429101008-9464-4-git-send-email-dingtianhong@huawei.com> Message-ID: <2443005.XhuHWvJbTU@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wednesday 15 April 2015 20:30:05 Ding Tianhong wrote: > The driver will alloc some skb buffer for hareware queue, but without > considering the case of memory allocation failure, when memory is low, > the skb may be null and panic the system, so break the loop when skb is > null and try to alloc the memory again to fix this problem. > > Signed-off-by: Ding Tianhong > Cc: "David S. Miller" > Cc: Eric Dumazet > Cc: Arnd Bergmann > Cc: Zhangfei Gao > Cc: Dan Carpenter > Cc: Joe Perches > Looks reasonable to me, though I haven't done a deep analysis to see if there are remaining problems in this area. Arnd