From patchwork Wed Jan 15 10:29:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 3491221 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C7949F169 for ; Wed, 15 Jan 2014 10:33:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 519892017E for ; Wed, 15 Jan 2014 10:33:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C5F1200F2 for ; Wed, 15 Jan 2014 10:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751306AbaAOKdb (ORCPT ); Wed, 15 Jan 2014 05:33:31 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:56879 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883AbaAOKda (ORCPT ); Wed, 15 Jan 2014 05:33:30 -0500 Received: by mail-pb0-f44.google.com with SMTP id rq2so952675pbb.17 for ; Wed, 15 Jan 2014 02:33:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BMzUjPIKsULlEfrzCKe4wgfUuDQ5PFaipO8mZUwDDek=; b=SDYdkAAsyeugVVTP/4hJQ9NOS5FdbsM+pv5CM6S8xMILtbr4jyqpxdunoAcjzcI0r5 fsV0ez57y1TkNBbFgUfWvQIcWOuHv7NzsFF/17cX29dw9ofhxvEhDrwmnYhoywHo6fqP pmIP7sSqr+iDCpGJF72wo7YyqnM/R7Gg4FcuClRMLghp4MFHuZpJyDNEOXy+WQzPN3mh UdvHLnueH9WPlyBuyJQPBYxwg62j2LTTQtw+zEPKM9PYDDrZnDq9L4gpnYjSFTfoq6L0 XVB5o9IX+ZpBbV4Sw9rpOiWt23hd1V+f/caLvkwvomYypci6LI0eKh//0ktcrkQwespR xh6A== X-Gm-Message-State: ALoCoQnMEJg/pTZ0tcOCxyrlFOqK99f21UM0cEnLSsT0rH6PLu0GdZx5mOcOgmu50TSG956p5l0I X-Received: by 10.66.139.169 with SMTP id qz9mr1880626pab.16.1389782010235; Wed, 15 Jan 2014 02:33:30 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id iu7sm7121558pbc.45.2014.01.15.02.33.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 Jan 2014 02:33:29 -0800 (PST) From: Sachin Kamat To: linux-mmc@vger.kernel.org Cc: chris@printf.net, tgih.jun@samsung.com, jh80.chung@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] mmc: dw_mmc: Fix NULL pointer dereference Date: Wed, 15 Jan 2014 15:59:13 +0530 Message-Id: <1389781753-28217-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If mrq->sbc is not NULL but data->stop happens to be NULL, it will lead to NULL pointer dereferencing. Avoid this by having a NULL check for data->stop. Signed-off-by: Sachin Kamat Acked-by: Seungwon Jeon --- drivers/mmc/host/dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 9ded62c8225e..8b3e58a5f9ed 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1345,7 +1345,7 @@ static void dw_mci_tasklet_func(unsigned long priv) if (!err) { if (!data->stop || mrq->sbc) { - if (mrq->sbc) + if (mrq->sbc && data->stop) data->stop->error = 0; dw_mci_request_end(host, mrq); goto unlock;