From patchwork Mon Nov 28 21:38:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 9450491 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 153426071C for ; Mon, 28 Nov 2016 21:39:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0731327BFF for ; Mon, 28 Nov 2016 21:39:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECED927F60; Mon, 28 Nov 2016 21:39:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9F1227BFF for ; Mon, 28 Nov 2016 21:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755342AbcK1Vjk (ORCPT ); Mon, 28 Nov 2016 16:39:40 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35883 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754361AbcK1Vjj (ORCPT ); Mon, 28 Nov 2016 16:39:39 -0500 Received: by mail-wm0-f68.google.com with SMTP id m203so21231045wma.3 for ; Mon, 28 Nov 2016 13:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NYsWIUjeKU+NEX9Lf1706itOG1x6YOOGSgUiJvOSo1s=; b=qWGE4lhjCcjOIddQVERZVIXDa1j+x4CQ2rVOA0ZAJuugkqmdvOTIjOqhRgk88AWXD/ o9iWN3/oNaZMjLY2pZL+K9v4DoPhNXsZWOEGWWxaLCTv+8O/Osu63XqvXTJEObtedbyF iI9CZ/NN6r0ZEopzCpTH1AzOs7Mytlcs/OIzM= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NYsWIUjeKU+NEX9Lf1706itOG1x6YOOGSgUiJvOSo1s=; b=hLOYi/MBMGSl1fU345H0TDMUmR4aPh8BlkkPAgaFExure5pqBfnJQqt3b4shkGawWM v19s/gw2skmk7Ooaf3Gg2TJ/ZmAweHWmNRrjV1r1BdNtc0ZYuKLP3adjyxgbFYO4zV6l lrBOjZoOMYVWAFPn+kzhIoERh3cFg9V1EVhmcks22uBP6UO+cgcOc7OQkJpirybdIaFh nt6AK1gEzCh+wPu5q7PwPJ6zp1JHvT4kPS8tMI8ExHCVoa6/ENyg+xyuQlmZTRzJJVPN h9oJdFn4iwJiZLCC7djMi3aQrS2CizJ26gfT1njAcGfc0ObeDjTxhyGJSQiOd9OjcxdG BXMg== X-Gm-Message-State: AKaTC00gkLmG4gvchN4lZOcZ4sAvcJJ0uHPZMal2RsB6vK0kKKrY0Fa5vJVAgqy/pBNGuw== X-Received: by 10.28.189.196 with SMTP id n187mr22533196wmf.133.1480369177899; Mon, 28 Nov 2016 13:39:37 -0800 (PST) Received: from Macroninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id w79sm30825843wmw.0.2016.11.28.13.39.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 13:39:37 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: axboe@fb.com, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 01/23] nvme: lightnvm: frees wrong cmd structure Date: Mon, 28 Nov 2016 22:38:52 +0100 Message-Id: <20161128213914.12516-2-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161128213914.12516-1-m@bjorling.me> References: <20161128213914.12516-1-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When struct nvme_request was introduced, the nvme_nvm_submit_io was converted to the new interface. The interface moves nvme_nvm_command data structure into the struct request pdu. On io completion, rq->cmd is freed, which should have been the dereferenced pdu nvme_request->cmd. Fixes: d49187e97e94 "nvme: introduce struct nvme_request" Signed-off-by: Matias Bjørling --- drivers/nvme/host/lightnvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 442f677..de3dc87 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -477,7 +477,7 @@ static void nvme_nvm_end_io(struct request *rq, int error) rqd->ppa_status = nvme_req(rq)->result.u64; nvm_end_io(rqd, error); - kfree(rq->cmd); + kfree(nvme_req(rq)->cmd); blk_mq_free_request(rq); }