From patchwork Fri Oct 15 13:00:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 256561 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9FCuoJ7031619 for ; Fri, 15 Oct 2010 12:56:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755661Ab0JOMzw (ORCPT ); Fri, 15 Oct 2010 08:55:52 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:56478 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754456Ab0JOMyK (ORCPT ); Fri, 15 Oct 2010 08:54:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id A324F19BCDC; Fri, 15 Oct 2010 14:54:08 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16742-16; Fri, 15 Oct 2010 14:54:07 +0200 (CEST) Received: from palace.topps.diku.dk (palace.ekstranet.diku.dk [192.38.115.202]) by mgw2.diku.dk (Postfix) with ESMTP id 174BE19BCCE; Fri, 15 Oct 2010 14:54:06 +0200 (CEST) From: Julia Lawall To: Christian Lamparter Cc: kernel-janitors@vger.kernel.org, "John W. Linville" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure Date: Fri, 15 Oct 2010 15:00:06 +0200 Message-Id: <1287147610-8041-3-git-send-email-julia@diku.dk> X-Mailer: git-send-email 1.7.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 15 Oct 2010 12:56:58 +0000 (UTC) diff -u -p a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c --- a/drivers/net/wireless/p54/eeprom.c +++ b/drivers/net/wireless/p54/eeprom.c @@ -261,8 +261,10 @@ static int p54_generate_channel_lists(st list->max_entries = max_channel_num; list->channels = kzalloc(sizeof(struct p54_channel_entry) * max_channel_num, GFP_KERNEL); - if (!list->channels) + if (!list->channels) { + ret = -ENOMEM; goto free; + } for (i = 0; i < max_channel_num; i++) { if (i < priv->iq_autocal_len) {