From patchwork Thu Mar 29 22:05:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10316549 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 CB5FF60353 for ; Thu, 29 Mar 2018 22:12:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4868285CE for ; Thu, 29 Mar 2018 22:12:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8A5B286B4; Thu, 29 Mar 2018 22:12:38 +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,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable 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 418A3285CE for ; Thu, 29 Mar 2018 22:12:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168AbeC2WMX (ORCPT ); Thu, 29 Mar 2018 18:12:23 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:40321 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752590AbeC2WHV (ORCPT ); Thu, 29 Mar 2018 18:07:21 -0400 Received: by mail-lf0-f68.google.com with SMTP id e5-v6so10343634lfb.7 for ; Thu, 29 Mar 2018 15:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uBcnRFFjaJdichxkSyY3iphzdmE4AR0cqAfsM/jAqIc=; b=rGeosNZ2LRnfMV9pU9rGpAGiWruTDJ3Hytjd7WPoz92Wb/GS0OD4BtxufcJfCWgajF p+PgGJl1KS0xgzOyoA96i7GJnxl4HFNpaJG44MgZSO7ilvPr9c3HSqteYlFIyWt0OqPl IC1GghdMVGjJtppfQPU0k45cLsi2S8FVjMO1TpSVTW73v3/C4UQhV2qdNvHX53uikrPU e+qnQLbEQMuX7wXVNBya0LANehf4L2dsFOY55HrFZpm1/V2rx/CMoHWneh0KXKgTXQSQ Fo6yRrBV0UE6tuINgtBMcMykUY6gZcaeOZ28ucsNnSDA3hLMiJW02mOgAKcbp245gy1C 5q/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uBcnRFFjaJdichxkSyY3iphzdmE4AR0cqAfsM/jAqIc=; b=Hvm1S5abDkMGsl1614aVdMenOwg3IOdkpBjBTm4FsULgfKp7hNgwM9CCFXKc9GAJar +tjfCELLqc97A2JqALcx2JlYJVDEmMZYGcwzZBuOslkgt48S22OrayBXkx9ljQaRKUDP AfrPaNfaxe+YRswT8xkl/dyplcDkaL3NzDWmf2eJ09zLeXwAg/5+hQi23turiQ+A1rCY e6ADPud062TJqx21+BfER2XD5yzfecbDVYpURXaa+i8TuOD3/EQb9dYOjxc79j0V5LvW sh1sGKkbXX4EtXrJ1nkLOdJH7kw1DvMBuv2o1jYjXWqls61ZJOjt8hemqH0q76mLG2YL z3Ug== X-Gm-Message-State: AElRT7Gsx5L8nmxoCW7D4V35RUlby7ygbnF0JfPKVSisqCsYIMiS9t52 FX1j3VB9Ek5NDSt/Q4hKGU8vlg== X-Google-Smtp-Source: AIpwx4+dDrscTmjRXE3Bnv9mpt2oVkKbj7iyTXXbrdFT8HeRNlIwaB54/+hl7fMMOowWsAcaeu4MUQ== X-Received: by 2002:a19:7904:: with SMTP id u4-v6mr6707740lfc.129.1522361240127; Thu, 29 Mar 2018 15:07:20 -0700 (PDT) Received: from Macroninja.cnexlabs.com (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.gmail.com with ESMTPSA id i89-v6sm1365508lfk.12.2018.03.29.15.07.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 15:07:19 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, keith.busch@intel.com, javier@cnexlabs.com, Heiner Litz , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 21/37] lightnvm: Avoid validation of default op value Date: Fri, 30 Mar 2018 00:05:08 +0200 Message-Id: <20180329220524.30363-22-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180329220524.30363-1-mb@lightnvm.io> References: <20180329220524.30363-1-mb@lightnvm.io> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Heiner Litz Fixes: 38401d231de65 ("lightnvm: set target over-provision on create ioctl") Signed-off-by: Heiner Litz Reviewed-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 5b197d6bb6d9..c4f12b1ae8b8 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -304,11 +304,9 @@ static int __nvm_config_extended(struct nvm_dev *dev, } /* op not set falls into target's default */ - if (e->op == 0xFFFF) + if (e->op == 0xFFFF) { e->op = NVM_TARGET_DEFAULT_OP; - - if (e->op < NVM_TARGET_MIN_OP || - e->op > NVM_TARGET_MAX_OP) { + } else if (e->op < NVM_TARGET_MIN_OP || e->op > NVM_TARGET_MAX_OP) { pr_err("nvm: invalid over provisioning value\n"); return -EINVAL; }