From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756547AbdELDPx (ORCPT ); Thu, 11 May 2017 23:15:53 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:23816 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756443AbdELDPu (ORCPT ); Thu, 11 May 2017 23:15:50 -0400 To: Johannes Thumshirn Cc: "Martin K . Petersen" , James Bottomley , Andrey Konovalov , Linux Kernel Mailinglist , Linux SCSI Mailinglist , Hannes Reinecke , Christoph Hellwig , Doug Gilbert Subject: Re: [PATCH v2] scsi: sg: don't return bogus Sg_requests From: "Martin K. Petersen" Organization: Oracle Corporation References: <20170510075340.12125-1-jthumshirn@suse.de> Date: Thu, 11 May 2017 23:15:34 -0400 In-Reply-To: <20170510075340.12125-1-jthumshirn@suse.de> (Johannes Thumshirn's message of "Wed, 10 May 2017 09:53:40 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Johannes, > If the list search in sg_get_rq_mark() fails to find a valid request, > we return a bogus element. This then can later lead to a GPF in > sg_remove_scat(). > > So don't return bogus Sg_requests in sg_get_rq_mark() but NULL in case > the list search doesn't find a valid request. Applied to 4.12/scsi-fixes, thanks! -- Martin K. Petersen Oracle Linux Engineering