Message ID | 1514808421-21993-15-git-send-email-gilad@benyossef.com |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp7796978qgn; Mon, 1 Jan 2018 04:09:53 -0800 (PST) X-Google-Smtp-Source: ACJfBouGXgYY7b9hAhuDwBiU3gskHmSCezMZaQF2a6X4mp8yxRBf/KsWNHKCiWXggTCmfCbM9vmp X-Received: by 10.98.17.196 with SMTP id 65mr42940205pfr.35.1514808593253; Mon, 01 Jan 2018 04:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514808593; cv=none; d=google.com; s=arc-20160816; b=bLidzkhtOAzm07wMX/kP2AKA14YmLH0w4tinaOQFwNVH9B23nX6uHIJ3cF1rXNngAu 8NWato8Zdrv8DT6otfnC4tsw+Rrsz1JcwhRImTbPSaoG8vxZtnwiZ0OxgFPqqhQuTXgi Z+sd76na0y6g1r8t3Ko0vVPU9qcMZVOKe20mZGdGpiuqu0Jq030y9+d8MWxQK+xqnXkC G/eJQLaV4+0aEw8/20tOhL2RBVoYBMXKWwMpWS0RzAg6+KozPrl4OdgYQSf4CBARF9ck tX9kB8uRIeAUgy1MwzakW0RKL08fKCJZR4iBrw3IH/04WsRQ4Z7EMX/Mh+5RFZpP+QzY UEjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=jt1/HboNL77p/Ojddjn3HrGFRawCdPXmy6VLumk/PKk=; b=dnPJdONaS56zythVwzG1xHIp+nSWdu9y26JVwYncqxfUGoZGGENkSC49RIP3gMcQNF sGDk34uFXZqQ1G8mPBOvbO5iKYizCaRFQJA/vPYWZSxX6SdBRGSjlUhyy8s3h2pXXVKL NaM7fTa2Ct2c3Fxt6/ESKKE+cDgFS93EpOitBRxrxPou1n4JrK7Njt1BTPu3bcojNKSV mffyBV21RuV1hkU4/Vz2/oHI3OG0cMNjWZr458KzkSWCwxT+lWnTAuHjTslgMKagucUj l0KXf6BETluf/IsSfI7YKz5986/uwXlsGemxTMgoyScrqFhzC/yh+iXm29vRWfstz6dH G6Ng== 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: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si30318059plr.483.2018.01.01.04.09.53; Mon, 01 Jan 2018 04:09:53 -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 S1751641AbeAAMJs (ORCPT <rfc822; dan.rue@linaro.org> + 28 others); Mon, 1 Jan 2018 07:09:48 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59174 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751616AbeAAMJq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 1 Jan 2018 07:09:46 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 347BC15A2; Mon, 1 Jan 2018 04:09:46 -0800 (PST) Received: from sugar.kfn.arm.com (unknown [10.45.48.158]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D80D3F41F; Mon, 1 Jan 2018 04:09:44 -0800 (PST) From: Gilad Ben-Yossef <gilad@benyossef.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Ofir Drang <ofir.drang@arm.com>, stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org Subject: [PATCH 14/26] staging: ccree: handle end of sg list gracefully Date: Mon, 1 Jan 2018 12:06:41 +0000 Message-Id: <1514808421-21993-15-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514808421-21993-1-git-send-email-gilad@benyossef.com> References: <1514808421-21993-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index 33b9709..cb3e235 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -94,7 +94,7 @@ static unsigned int cc_get_sgl_nents(struct device *dev, { unsigned int nents = 0; - while (nbytes) { + while (nbytes && sg_list) { if (sg_list->length) { nents++; /* get the number of bytes in the last entry */
If we are asked for number of entries of an offset bigger than the sg list we should not crash. Cc: stable@vger.kernel.org Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> --- drivers/staging/ccree/ssi_buffer_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4