Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3009045pxb; Mon, 18 Oct 2021 06:31:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFW2XLL+9CslzcnifXHkpE1n3wwul85Ik9lCxdGr/7ShmAW3oigQMQK1/uyjD1w09oYfwV X-Received: by 2002:a63:f356:: with SMTP id t22mr23725846pgj.18.1634563900608; Mon, 18 Oct 2021 06:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634563900; cv=none; d=google.com; s=arc-20160816; b=gtQPA98RsUCm5lafbjQrx+Nyv3k8kD9Sn7oI+OJuf3BOnOkUpLaPlPX7tZfCxKZjm8 Lw8oO8hQq+ihnPuDhDmZeczz4SuYyQ9yZhZWDz39rLHQIhFSE7VzKnFaTo1kjLTBlMAD p0ui+k57HDtHEmdsar/E3gL8xz3lG+E9IIVauoaJl4KdvFMBPwyiHa+uUCgsrAaSM/4z jRwo+UyfurrhbrQy7JziBU7m8AuxPlu/lZVQxWs/VF8CDt0Ci4JVHvDjg+a/Q3dCrlpi HtB41k5BX5N73oISGrVrtvo+axO/hVCUNPBa6J1CBjG+dPMDrY3fGXfSKu20JfVFazMZ kHAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HTNM17BAnaM1ENkmFWi6ADe2v1f4zuWRZkH1PM1jZKI=; b=YHF8/AM6jOFIcjv0TqL54SQR1FD2yUriAUaEVR5Ie95HJT2BC4HJuc/wLtxF/RdwPW ImCqakoeQa8RWjkZHKvEpDlGAxuNW0nwZnrO4sj1hINE/JYL1EM7t4x1tVSz5JTQA7HO xDyXCQeFcXCbgfekPHyUwT+fb/au01s5o72Q6+0faWhIbvrG/wfEIrnjguAFuh/jw/yc kpPxWMSeSSoD3iGonf7loqHcYDg6qjHiM5WebtVNhjpnkVwwokrcfLXVBRHjkasqXwGo jnMpkMSzUZgiO2BKmpvax84SENG7AOTaxzuvW8PKY7pTAhRVNINmnudF4tqOL0MW9Vvk bBHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qeYjh4Dp; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si26422710plg.171.2021.10.18.06.31.26; Mon, 18 Oct 2021 06:31:40 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=qeYjh4Dp; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232688AbhJRNck (ORCPT + 99 others); Mon, 18 Oct 2021 09:32:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:42924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232630AbhJRNam (ORCPT ); Mon, 18 Oct 2021 09:30:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2A93F61283; Mon, 18 Oct 2021 13:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563704; bh=Fi+MQuVZW2s4eIkrf/YXM+gZO3s7kYjC9jYF868VHTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qeYjh4Dp3vQVoF7F6jEqEfXvetKZihv/JuVLhGm4mRdGv5H1sMBOt18JyiuzEDUH6 x2i6jJJwF/Km8t/u5lnhd25qGj2Vqnkt+8zzrQXLbK5GSgoNSlFmbW0vlDC7IiyctX ghtXOtNNpn9zEgysACqqmVHXK+9ZtrlM5WEItqsM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Jonathan Cameron Subject: [PATCH 4.19 32/50] iio: dac: ti-dac5571: fix an error code in probe() Date: Mon, 18 Oct 2021 15:24:39 +0200 Message-Id: <20211018132327.597027663@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132326.529486647@linuxfoundation.org> References: <20211018132326.529486647@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit f7a28df7db84eb3410e9eca37832efa5aed93338 upstream. If we have an unexpected number of channels then return -EINVAL instead of returning success. Fixes: df38a4a72a3b ("iio: dac: add TI DAC5571 family support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210816183954.GB2068@kili Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/dac/ti-dac5571.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/iio/dac/ti-dac5571.c +++ b/drivers/iio/dac/ti-dac5571.c @@ -355,6 +355,7 @@ static int dac5571_probe(struct i2c_clie data->dac5571_pwrdwn = dac5571_pwrdwn_quad; break; default: + ret = -EINVAL; goto err; }