From patchwork Fri Nov 18 11:15:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Arefev X-Patchwork-Id: 22271 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp132912wrr; Fri, 18 Nov 2022 03:21:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf5JboIjwBx5mQPhPfc2nLtNyXWWv/L7PFvjGrLAcGNPvEQ5cqpzmx/Op0NQF+yx+53PWH2K X-Received: by 2002:a17:907:75f3:b0:78d:b046:aaae with SMTP id jz19-20020a17090775f300b0078db046aaaemr5398963ejc.218.1668770495301; Fri, 18 Nov 2022 03:21:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668770495; cv=none; d=google.com; s=arc-20160816; b=hPaQy93WTsqx4grimwi0pccKEgiRy3vupVe1cV670/VD9kV5IK+0z2ydX2Z+wq2EXW 7r1scM156XOSNLiFfEZF/MmSnj6fwvokJ/THadWCnECqRm/FqUyxNLv+ImxitXBaoXQt zC683SdmEzMoW6hv9Wd+BvMIZIFb9M3DVd23IIl5/KU3b8qX/JZdJcXemlM1f+XnMIC4 go/Ch6ekL7w6PLC62FFG2Q+Q3ZCX0REIZZ93vMV8M6Fr95tEACkQ4iziCHCmbffQtOPE bJenkLA0xFNKOn8jkAXHn3nRfCYQBWftbvFXW4Le5pBn1LpRRmH/hI5GUebm3q3dHd5p A5kg== 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 :message-id:date:subject:cc:to:dkim-signature:from; bh=oJ+C4azwrz0T1Xq/DoyYfvD0U7Rp9/tHMKhuIZvRgnw=; b=pLGA9vkLBcsM/sTuNdINKqZ1RFztCgPhxGZyswkogJ7OdKH85749PKOXzgH8TO+roW jTfT+asxYfpqEG/ltj+nfXI0Cp//L7Uy31hnSdGGHgTk5pN4J8hN8I0UQmym+A+BsPpF 0W76lInuYiMkUQjaJ43RQURAQU5jpejM1t4SKV3LtOZZ9WUCjLVVkuyNd0Wjx27uamt7 Ng5RZYzpVp6AIW3+J5fpOf2JMxt4B87vflH+dZddvgaeAwTPXM4kQxcCCUbSWv+yTV20 eXpMhH/4LpPcIpueyh9DN9alqsWrPIhMgdbb5JVIz2nyPYOH75SQr0sYgcCt+wXG1QU1 hixA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@swemel.ru header.s=mail header.b=UXv93xb3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=swemel.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ck9-20020a170906c44900b0078dcc87b1c4si2361393ejb.923.2022.11.18.03.21.09; Fri, 18 Nov 2022 03:21:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@swemel.ru header.s=mail header.b=UXv93xb3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=swemel.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241647AbiKRLPa (ORCPT + 99 others); Fri, 18 Nov 2022 06:15:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241421AbiKRLP2 (ORCPT ); Fri, 18 Nov 2022 06:15:28 -0500 Received: from mx.swemel.ru (mx.swemel.ru [95.143.211.150]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E893761528 for ; Fri, 18 Nov 2022 03:15:25 -0800 (PST) From: Denis Arefev DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=swemel.ru; s=mail; t=1668770123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oJ+C4azwrz0T1Xq/DoyYfvD0U7Rp9/tHMKhuIZvRgnw=; b=UXv93xb3Ze7gwRU/niYHPo3H8MG295UqhEN+zk73xSRUqM4ciw45FZo1nKtqpHh2Mrc7PH ZdievLhBH4bgiNb6TJQfqxrW2fw//08XMDpZHa6QtTe2f36gylCDqp1OmZDUvT40AtTbI6 RQhB8KS7LvQMYv8ILX/jQ56hazsUb+Y= To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, trufanov@swemel.ru, vfh@swemel.ru Subject: [PATCH] staging: rts5208: Added value check Date: Fri, 18 Nov 2022 14:15:23 +0300 Message-Id: <20221118111523.123463-1-arefev@swemel.ru> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749832690541657087?= X-GMAIL-MSGID: =?utf-8?q?1749832690541657087?= Added value check. Return value of a function 'ms_set_rw_reg_addr' called at ms.c:1770 is not checked, but it is usually checked for this function Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Denis Arefev --- drivers/staging/rts5208/ms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index 9001570a8c94..e884ee5da317 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -1769,6 +1769,8 @@ static int ms_copy_page(struct rtsx_chip *chip, u16 old_blk, u16 new_blk, retval = ms_set_rw_reg_addr(chip, OVERWRITE_FLAG, MS_EXTRA_SIZE, SYSTEM_PARAM, (6 + MS_EXTRA_SIZE)); + if (retval != STATUS_SUCCESS) + return STATUS_FAIL; ms_set_err_code(chip, MS_NO_ERROR);