Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1910138imm; Thu, 24 May 2018 02:46:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqQCwJG5lS3VavX1qNKv5h9rVCwmaCAHO88K1EOJEAjULLpZvTFeaMdhmXxCaOT4V9WCJGr X-Received: by 2002:a17:902:74cc:: with SMTP id f12-v6mr2052295plt.7.1527155194347; Thu, 24 May 2018 02:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527155194; cv=none; d=google.com; s=arc-20160816; b=Pq/eALh3PXzf5wKhAp31Wwnhd5EFgv3GKUqGTdQvu2gWnAOULc93rRmVNxXuyFGc5+ Sx87SOCMI1NQx0iVxrh2WRnkVjFVH7ReOpCUDcCFK8TSVxt3eXHlfAEr95X2wT/S+A3S E/yQ3zvjWZ58xMr+pa0c0zTnOMCqD7IixOyMNPSbx2+JOY7EZ23mAo7W0QRWocsbLQ2G R3YpmV9RYRu5rW9WPcEzucjcxTcDUXz7fVOJ49I+YMbaiz9E8AGDbjZkdwfaYBFJLnGN 3fPXxZrvyMPCvxWTZmKVXqc/NX0OZrIGWKm8bMXdTuVuYGxWXEQUQYowHi2Ki8brlbX4 f5qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=65ysozgfHi9HEUWy+lECQ3E+hEE4QNB1PV2ALSoDh4U=; b=OM2+9ugyU9xlrQoufBzIHvQdl9zZJaim9sxV5ZrzMzWIjHr+IGh7apnhFRX1LtL6B9 xNV/IGGUWI0iCdj6o4mAKJhTdwFeMcGo07kJ8DBolPEvD1LuZ61jLWfv+dXzHwvfGLsc S2Qp0mSEVPGzIsW6i9pKDqLEikn4duvkBmLoUCrm1L8I6EvNJvR2P4c30fsCyYVWtciZ o+aOqkwgjrpiymKE8OJWmNRixzJFpbGeEOgwsWv6IFMd5L4pDSnAo8vTvkaMAQMXGtAA x49vPWHNA70qY/3VKoaLQUQ2ENEsdrtfSlczot9x2hegli2MBpl6YZ7d9qsFI0b/7ymE nGlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h6s4ZNs5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si20154688plz.101.2018.05.24.02.46.19; Thu, 24 May 2018 02:46:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h6s4ZNs5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966780AbeEXJpX (ORCPT + 99 others); Thu, 24 May 2018 05:45:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:56404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966756AbeEXJpN (ORCPT ); Thu, 24 May 2018 05:45:13 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25ED0208CE; Thu, 24 May 2018 09:45:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155112; bh=qsCpukWWb4ZClKLTsHEul1fmPRS63cn7/PpEkSi9N0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h6s4ZNs5N31OhjPE+0b3WH30f7sEeUwzb1q0l3sHQyv2c9v+chFOBS3ABhz7h7cYJ XdCpzHtoQfq1wd8ZoAq4FyAcS7HUE7b9BxnX2avCC9jX8Gaewvr0uUNREC21NUDTV+ 0xRiGscu/iNOVdFoSeVDgLZISOaTtql7E17xdggA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , Martin Schwidefsky Subject: [PATCH 4.4 60/92] s390/qdio: dont release memory in qdio_setup_irq() Date: Thu, 24 May 2018 11:38:37 +0200 Message-Id: <20180524093205.063361246@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093159.286472249@linuxfoundation.org> References: <20180524093159.286472249@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julian Wiedmann commit 2e68adcd2fb21b7188ba449f0fab3bee2910e500 upstream. Calling qdio_release_memory() on error is just plain wrong. It frees the main qdio_irq struct, when following code still uses it. Also, no other error path in qdio_establish() does this. So trust callers to clean up via qdio_free() if some step of the QDIO initialization fails. Fixes: 779e6e1c724d ("[S390] qdio: new qdio driver.") Cc: #v2.6.27+ Signed-off-by: Julian Wiedmann Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/qdio_setup.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) --- a/drivers/s390/cio/qdio_setup.c +++ b/drivers/s390/cio/qdio_setup.c @@ -456,7 +456,6 @@ int qdio_setup_irq(struct qdio_initializ { struct ciw *ciw; struct qdio_irq *irq_ptr = init_data->cdev->private->qdio_data; - int rc; memset(&irq_ptr->qib, 0, sizeof(irq_ptr->qib)); memset(&irq_ptr->siga_flag, 0, sizeof(irq_ptr->siga_flag)); @@ -493,16 +492,14 @@ int qdio_setup_irq(struct qdio_initializ ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_EQUEUE); if (!ciw) { DBF_ERROR("%4x NO EQ", irq_ptr->schid.sch_no); - rc = -EINVAL; - goto out_err; + return -EINVAL; } irq_ptr->equeue = *ciw; ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_AQUEUE); if (!ciw) { DBF_ERROR("%4x NO AQ", irq_ptr->schid.sch_no); - rc = -EINVAL; - goto out_err; + return -EINVAL; } irq_ptr->aqueue = *ciw; @@ -510,9 +507,6 @@ int qdio_setup_irq(struct qdio_initializ irq_ptr->orig_handler = init_data->cdev->handler; init_data->cdev->handler = qdio_int_handler; return 0; -out_err: - qdio_release_memory(irq_ptr); - return rc; } void qdio_print_subchannel_info(struct qdio_irq *irq_ptr,