From patchwork Mon Jan 4 11:21:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitra Basappa X-Patchwork-Id: 7947061 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 25AA39F1CC for ; Mon, 4 Jan 2016 11:21:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 472692035E for ; Mon, 4 Jan 2016 11:21:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58FF3202F8 for ; Mon, 4 Jan 2016 11:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbcADLVl (ORCPT ); Mon, 4 Jan 2016 06:21:41 -0500 Received: from mail-yk0-f172.google.com ([209.85.160.172]:34631 "EHLO mail-yk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752758AbcADLVk (ORCPT ); Mon, 4 Jan 2016 06:21:40 -0500 Received: by mail-yk0-f172.google.com with SMTP id a85so166721485ykb.1 for ; Mon, 04 Jan 2016 03:21:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc:content-type; bh=YVuW37ND/brIUpBvLRsN4raYMeiA95O2Fd4iyw+B7zA=; b=uy6eoJR7VChhdBOj+51PRy83+aH/COAD2gZD7y4Ah81UsImhCpN9YNTpjnDx+ap13u H8G7GA1mFjoHXPruOm1uEs2jm7oVJGYktyqiTjvHxsgTdl+Vi0B2TSEkxx+2CaVQ4Z5c AXR96BiLu3rvpqxICDzt7Zj9MaODce9ZKZ+fI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type; bh=YVuW37ND/brIUpBvLRsN4raYMeiA95O2Fd4iyw+B7zA=; b=ebGCCrdAt9wBKluQjAKkfeWINiqeX/t7lWrluQS5Yz/rHlMwI0yxdYRN3H2Et0HQ5u 3cruNeoehMYvcmegr7HFK+uJgI5G3z35xKQArVsspjFqKdOdJvZwmkkzU8dFsST2CmZk n44wwdvN7TcjDYgfc49+BmNPmujCxt19trFLEaMD2KCVN+tuiThrQB1sRRiAQVEJeO0Q TGm0Zq3jqqE2yxVnIv99BBIrnGnGWIfpnfqhQxeBNPPaWY19QMzXjt+9YQLENIL+dWyX Gg41ftCbddRbEzfc8JS0TWA7am2Nn2mokUoZIYnfoXObCjJRRMOFuNHZHLrDpOBx64jP U0/w== X-Gm-Message-State: ALoCoQkzKb8xsqN5zqLlC6rNWIQRr7Gn8AfmK+8wpB8gWtbUaccZo1pVEfbg06YJ3QBFOde3S2uSi3ovdyJXEUG30zK640j9dYoOVDMHuB6nMbv030p7fc4= X-Received: by 10.129.72.130 with SMTP id v124mr61633369ywa.87.1451906500251; Mon, 04 Jan 2016 03:21:40 -0800 (PST) From: Chaitra Basappa References: <1450876907-3913-1-git-send-email-thenzl@redhat.com> In-Reply-To: <1450876907-3913-1-git-send-email-thenzl@redhat.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQMui5ef0QS3t/RPvJ7mb7Sqs3sz9pwwntCQ Date: Mon, 4 Jan 2016 16:51:38 +0530 Message-ID: Subject: RE: [PATCH] mpt3sas: a correction in unmap_resources To: Tomas Henzl , linux-scsi@vger.kernel.org Cc: Kashyap Desai , mlombard@redhat.com Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Hi, Please consider this patch as Ack-by: Chaitra P B Thanks, Chaitra -----Original Message----- From: Tomas Henzl [mailto:thenzl@redhat.com] Sent: Wednesday, December 23, 2015 6:52 PM To: linux-scsi@vger.kernel.org Cc: kashyap.desai@avagotech.com; chaitra.basappa@avagotech.com; mlombard@redhat.com Subject: [PATCH] mpt3sas: a correction in unmap_resources It might happen that we try to free an already freed pointer. Tomas Reported-by: Maurizio Lombardi Signed-off-by: Tomas Henzl --- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) iounmap(ioc->chip); diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index d4f1dcdb83..3b09b3d09f 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -1827,8 +1827,10 @@ mpt3sas_base_unmap_resources(struct MPT3SAS_ADAPTER *ioc) _base_free_irq(ioc); _base_disable_msix(ioc); - if (ioc->msix96_vector) + if (ioc->msix96_vector) { kfree(ioc->replyPostRegisterIndex); + ioc->replyPostRegisterIndex = NULL; + } if (ioc->chip_phys) {