Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2148973pxu; Sun, 6 Dec 2020 21:25:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfUam8TW4tNfRkE4w3OoWNdWXvBkDm7R/RAdJ9+nxQSOjobEhiaE3NB7a154aoZc01Nk+s X-Received: by 2002:a17:907:11ca:: with SMTP id va10mr16022636ejb.78.1607318730217; Sun, 06 Dec 2020 21:25:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607318730; cv=none; d=google.com; s=arc-20160816; b=aNkr0LSiLC9h8qBlPD1KTrxqKa/9M5gza6PDgFT5dH7foxRwssVpotSuz+Kr8oxbH2 9ZemtRb6YPeUiu7jD+MOAbZ61Iyz3bCRsAyTT6sNN2ZcPyLFRBGKoeuJ6y5C/a6B0dP/ D4vkrc2uwtoX2ObSVUSYKbXjLh0wUmKSVn4eNKW7df7vfh3VdHPgWJdOi1NdfRfPzlLR rihCQDinTXpVAN2HMFLIv/AEE9ev9KneeqrQNrGW+qDoFkDvnZ4FeMNKw5OOHrXmHSUk IgANhIydeeRPtd/MMzWdsYrxB5MFhZe5xi+F5SOgPLuPFZkoSQL3hwH0aZ6XVa/sOZlO iPqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=4NEmPb1vJdnm+1yHtk70TIfP0G6eCyJYhuhh3SVbKYs=; b=wCG1IM8+bnS+XiMoBpnoQxkD0F6VcahixqkmlUZhoNZ7EbMpAHR72bbRpFfQiEU8fE 9DutGmR/9GXs1zdPSCWaiskFFjc4yvkyr9bzUx2d1Ej3Zz0WPtw6nsJR92LTTnzMNTRQ +xY7qMjgke5zMK4uIsSXdI17mB8nuaCk92ALrwuIYlRwZwM0rAGvpWB4as5GMzQP7kCN tesnf/JPzfRRpr8XtGBzaVer2D8hWeQz2FkRh/6yNp76zLqVZFlbKNKJWxLXeOMHa//H zn59HMTWp1fHyiuJ3mWwSHQb5+0qvtHt6bCAZ80mJqEslJPvZsULU3mTdt39noiSTrrN NHdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QcHsliSt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bk9si5910345ejb.252.2020.12.06.21.24.52; Sun, 06 Dec 2020 21:25:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QcHsliSt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725853AbgLGFTQ (ORCPT + 99 others); Mon, 7 Dec 2020 00:19:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:45631 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbgLGFTQ (ORCPT ); Mon, 7 Dec 2020 00:19:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607318269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4NEmPb1vJdnm+1yHtk70TIfP0G6eCyJYhuhh3SVbKYs=; b=QcHsliStAPyrfP5n+aAYJ9NsgFTopiU8XjWL8kSm1p/t1s0fl3Mby8F7NgUPRvv0mx+yb/ 2GBMYfZ8y0aYwqTRiXFxDn53w45qpJwwPGLj/ehRJqvyrFWbby7FcJcIxwWblccKKcge7b gGYD7OdEoXhTno8lUSu8a6qQjgqWq1c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-286-YHvFQFlePI672EkIO4xVIg-1; Mon, 07 Dec 2020 00:17:47 -0500 X-MC-Unique: YHvFQFlePI672EkIO4xVIg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 43ED7100C602; Mon, 7 Dec 2020 05:17:46 +0000 (UTC) Received: from [10.72.13.171] (ovpn-13-171.pek2.redhat.com [10.72.13.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id B77D810016FA; Mon, 7 Dec 2020 05:17:36 +0000 (UTC) Subject: Re: [PATCH] vhost scsi: fix error return code in vhost_scsi_set_endpoint() To: Zhang Changzhong , "Michael S. Tsirkin" , Paolo Bonzini , Stefan Hajnoczi , Mike Christie , Maurizio Lombardi Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1607071411-33484-1-git-send-email-zhangchangzhong@huawei.com> From: Jason Wang Message-ID: <754d3d21-1dfa-6675-5014-2e8fb102c363@redhat.com> Date: Mon, 7 Dec 2020 13:17:35 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1607071411-33484-1-git-send-email-zhangchangzhong@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/12/4 下午4:43, Zhang Changzhong wrote: > Fix to return a negative error code from the error handling > case instead of 0, as done elsewhere in this function. > > Fixes: 25b98b64e284 ("vhost scsi: alloc cmds per vq instead of session") > Reported-by: Hulk Robot > Signed-off-by: Zhang Changzhong > --- > drivers/vhost/scsi.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c > index 6ff8a5096..4ce9f00 100644 > --- a/drivers/vhost/scsi.c > +++ b/drivers/vhost/scsi.c > @@ -1643,7 +1643,8 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs, > if (!vhost_vq_is_setup(vq)) > continue; > > - if (vhost_scsi_setup_vq_cmds(vq, vq->num)) > + ret = vhost_scsi_setup_vq_cmds(vq, vq->num); > + if (ret) > goto destroy_vq_cmds; > } > Acked-by: Jason Wang