From patchwork Mon Mar 22 05:44:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuo Handa X-Patchwork-Id: 48251 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4BBFFB7D09 for ; Mon, 22 Mar 2010 16:44:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753512Ab0CVFod (ORCPT ); Mon, 22 Mar 2010 01:44:33 -0400 Received: from wine.ocn.ne.jp ([122.1.235.145]:62522 "EHLO smtp.wine.ocn.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753234Ab0CVFod (ORCPT ); Mon, 22 Mar 2010 01:44:33 -0400 Received: from CLAMP (p6003-ipbf606marunouchi.tokyo.ocn.ne.jp [124.86.39.3]) by smtp.wine.ocn.ne.jp (Postfix) with ESMTP id 25B812BD2; Mon, 22 Mar 2010 14:44:32 +0900 (JST) To: dhowells@redhat.com Cc: netdev@vger.kernel.org Subject: [PATCH 2.6.34-rc2] rxrpc: Check allocation failure. From: Tetsuo Handa Message-Id: <201003221444.JID21821.FQJOSLFMOFtHOV@I-love.SAKURA.ne.jp> X-Mailer: Winbiff [Version 2.51 PL2] X-Accept-Language: ja,en,zh Date: Mon, 22 Mar 2010 14:44:31 +0900 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org alloc_skb() can return NULL. Signed-off-by: Tetsuo Handa --- net/rxrpc/ar-accept.c | 5 +++++ 1 file changed, 5 insertions(+) -- 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 --- linux-2.6.34-rc2.orig/net/rxrpc/ar-accept.c +++ linux-2.6.34-rc2/net/rxrpc/ar-accept.c @@ -88,6 +88,11 @@ static int rxrpc_accept_incoming_call(st /* get a notification message to send to the server app */ notification = alloc_skb(0, GFP_NOFS); + if (!notification) { + _debug("no memory"); + ret = -ENOMEM; + goto error; + } rxrpc_new_skb(notification); notification->mark = RXRPC_SKB_MARK_NEW_CALL;