Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3334338imu; Sun, 11 Nov 2018 12:36:35 -0800 (PST) X-Google-Smtp-Source: AJdET5c2lLDa7Tioikezw7QvNpDbZN5f5O6KnhE1qm+nE7tsXYayebdlhtThBbgRD6GU1FFyuFP8 X-Received: by 2002:a17:902:4401:: with SMTP id k1-v6mr16792005pld.272.1541968595825; Sun, 11 Nov 2018 12:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968595; cv=none; d=google.com; s=arc-20160816; b=WzhNSI2POwijHh7uOqPAy7jukkR54td0fE9ww9HtcnMhsySWMKR7yQRlfpW0Sj8CZI mywViDfcU+L+WIpXuTIC3pmBhQzFCfq40IdRVwgd1d72pihvTJQd6UbudQN2puSR/+Vo 5JcYpppz0dIPrUkT2PgAUiF2QPeLROydEJny7DjfEkeUAdVxRZVUN/MDDfjM+5K8x3Jq B7DK21kdAIK27VGZDNgTAJV22ZxgQkKfPQ+kEVFyH3xP+DH/re5MIwGJBBdZhHClc/2p nigz/fX6xKj+83cZJdkCjMTCFVyZ6tMZIC3qGm3EFekGHZRKJem7ZqbJyMRcxKOcfe0u kgOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=mGHG5nBHFL46dGsPEvdsDjW/S7h4RhsKR0aTH5irebo=; b=C02QZmbgUrjSx4qpVIfiQ0EvT2OZ8cBUDmeM5GeDcK+uPWyTeASjma9MAlqAJM2AgX pANyBDr/cTklaNGRC15sUG/0wcf34fsQCu/9dmHiGGNAATZlLBh9YxByX5HvIN1X7sbI CLH5xOpGU7HYMEhdl97ocHNzAP7jhk3lTDUE/LthI6ctvHGsfkpgEM/vfkFSyzn/aS0i /UzPlwlY6U8fscY1PUtVAtnRPNUFU5JpEY2aHdcxBusKDj+TeYtyS1u6qHYUi/ZOQ7Fj FoY/4DgfwX+Jdm7tTX1eb1VQZNiy0IwSxlqljd+YP1Z0tvnE2K3zZOretWBt8Ywrz71w lA4g== ARC-Authentication-Results: i=1; mx.google.com; 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 p5-v6si13130511pga.576.2018.11.11.12.36.20; Sun, 11 Nov 2018 12:36:35 -0800 (PST) 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; 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 S1730282AbeKLGZe (ORCPT + 99 others); Mon, 12 Nov 2018 01:25:34 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49880 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730051AbeKLFsM (ORCPT ); Mon, 12 Nov 2018 00:48:12 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsY-0000oM-TI; Sun, 11 Nov 2018 19:58:43 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsW-0001it-CT; Sun, 11 Nov 2018 19:58:40 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Dan Carpenter" , "David S. Miller" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 249/366] qlogic: check kstrtoul() for errors In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit 5fc853cc01c68f84984ecc2d5fd777ecad78240f upstream. We accidentally left out the error handling for kstrtoul(). Fixes: a520030e326a ("qlcnic: Implement flash sysfs callback for 83xx adapter") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c @@ -1122,6 +1122,8 @@ static ssize_t qlcnic_83xx_sysfs_flash_w return QL_STATUS_INVALID_PARAM; ret = kstrtoul(buf, 16, &data); + if (ret) + return ret; switch (data) { case QLC_83XX_FLASH_SECTOR_ERASE_CMD: