From patchwork Tue Feb 12 12:24:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 2128141 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id BF9433FDF1 for ; Tue, 12 Feb 2013 12:25:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933226Ab3BLMZU (ORCPT ); Tue, 12 Feb 2013 07:25:20 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:27459 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933103Ab3BLMZR (ORCPT ); Tue, 12 Feb 2013 07:25:17 -0500 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r1CCP7FT024092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 12 Feb 2013 12:25:08 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r1CCP6QM029394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Feb 2013 12:25:07 GMT Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r1CCP6Vx018785; Tue, 12 Feb 2013 06:25:06 -0600 Received: from elgon.mountain (/41.212.103.53) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 12 Feb 2013 04:25:05 -0800 Date: Tue, 12 Feb 2013 15:24:54 +0300 From: Dan Carpenter To: Chris Ball Cc: Seungwon Jeon , Namjae Jeon , Konstantin Dorfman , Venkatraman S , linux-mmc@vger.kernel.org, kbuild@01.org, kernel-janitors@vger.kernel.org Subject: [patch] mmc: check correct variable after kzalloc() Message-ID: <20130212122454.GC19045@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org There is a typo here so we check "mqrq_cur->packed" instead of "mqrq_prev->packed". Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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/mmc/card/queue.c b/drivers/mmc/card/queue.c index c0d1315..97a848b 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c @@ -378,7 +378,7 @@ int mmc_packed_init(struct mmc_queue *mq, struct mmc_card *card) } mqrq_prev->packed = kzalloc(sizeof(struct mmc_packed), GFP_KERNEL); - if (!mqrq_cur->packed) { + if (!mqrq_prev->packed) { pr_warn("%s: unable to allocate packed cmd for mqrq_prev\n", mmc_card_name(card)); kfree(mqrq_cur->packed);