From patchwork Thu Mar 2 05:14:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 9599539 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 1E8BA60414 for ; Thu, 2 Mar 2017 05:25:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED3F32236A for ; Thu, 2 Mar 2017 05:25:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E211227D9B; Thu, 2 Mar 2017 05:25:34 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 919782236A for ; Thu, 2 Mar 2017 05:25:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750733AbdCBFZe (ORCPT ); Thu, 2 Mar 2017 00:25:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54546 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbdCBFZd (ORCPT ); Thu, 2 Mar 2017 00:25:33 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FC2215552; Thu, 2 Mar 2017 05:14:45 +0000 (UTC) Received: from rh2.redhat.com (unknown [10.10.122.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF80F2D654; Thu, 2 Mar 2017 05:14:44 +0000 (UTC) From: Mike Christie To: target-devel@vger.kernel.org, nab@linux-iscsi.org Cc: Mike Christie Subject: [PATCH 2/3] tcmu: return on first Opt parse failure Date: Wed, 1 Mar 2017 23:14:40 -0600 Message-Id: <1488431681-15481-3-git-send-email-mchristi@redhat.com> In-Reply-To: <1488431681-15481-1-git-send-email-mchristi@redhat.com> References: <1488431681-15481-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 02 Mar 2017 05:14:45 +0000 (UTC) Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We only were returing failure if the last opt to be parsed failed. This has a return failure when we first detect a failure. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index b1444a3..266dc82 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -1120,6 +1120,9 @@ static ssize_t tcmu_set_configfs_dev_params(struct se_device *dev, default: break; } + + if (ret) + break; } kfree(orig);