From patchwork Wed Apr 13 20:32:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Ball X-Patchwork-Id: 705701 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 p3DKReQP007461 for ; Wed, 13 Apr 2011 20:27:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757552Ab1DMU1k (ORCPT ); Wed, 13 Apr 2011 16:27:40 -0400 Received: from pullcord.laptop.org ([18.85.46.20]:56362 "EHLO pullcord.laptop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758515Ab1DMU1k (ORCPT ); Wed, 13 Apr 2011 16:27:40 -0400 Received: from pullcord.laptop.org (localhost.localdomain [127.0.0.1]) by pullcord.laptop.org (8.14.4/8.14.4) with ESMTP id p3DKWOii017362; Wed, 13 Apr 2011 16:32:24 -0400 Received: (from cjb@localhost) by pullcord.laptop.org (8.14.4/8.14.4/Submit) id p3DKWOAD017360; Wed, 13 Apr 2011 16:32:24 -0400 From: Chris Ball To: linux-mmc@vger.kernel.org Cc: Chris Ball Subject: [PATCH 1/2] mmc: core: Fix use of uninitialized data in mmc_send_if_cond. Date: Wed, 13 Apr 2011 16:32:09 -0400 Message-Id: <1302726730-17324-1-git-send-email-cjb@laptop.org> X-Mailer: git-send-email 1.7.0.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 13 Apr 2011 20:27:41 +0000 (UTC) mmc_send_if_cond did not zero out mmc_command on stack. Signed-off-by: Chris Ball --- drivers/mmc/core/sd_ops.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/core/sd_ops.c b/drivers/mmc/core/sd_ops.c index 71fdb07..da50849 100644 --- a/drivers/mmc/core/sd_ops.c +++ b/drivers/mmc/core/sd_ops.c @@ -201,6 +201,8 @@ int mmc_send_if_cond(struct mmc_host *host, u32 ocr) static const u8 test_pattern = 0xAA; u8 result_pattern; + memset(&cmd, 0, sizeof(struct mmc_command)); + /* * To support SD 2.0 cards, we must always invoke SD_SEND_IF_COND * before SD_APP_OP_COND. This command will harmlessly fail for