From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31BEDC43461 for ; Wed, 9 Sep 2020 09:45:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D27FA2076C for ; Wed, 9 Sep 2020 09:45:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="NBXW4xlt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgIIJpy (ORCPT ); Wed, 9 Sep 2020 05:45:54 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:34260 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbgIIJpx (ORCPT ); Wed, 9 Sep 2020 05:45:53 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0899jXSi123770; Wed, 9 Sep 2020 09:45:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=TGq+6rYwlg/uwvAKvlFGOsEuzrOSQqAoPF3hnYTGdOk=; b=NBXW4xltydo2ugLrN4uDnE9ygNrD4l6bl4ydcHf5LPGudnl3qtXfWmnAMgaRHgx6MJ9g X5bUd/yFHB7CHRlCDIAN79ikJjFjfFTIvLYMHbZ4GiU/MJ3CrSt2XCjzDQA54DcaPI2+ u1dSBpqwybdG4gPFK/KfSz6yPgUzGqec03UYL8DBKqWz18Z3fxjSsB2YG9AGIKquqF5v fshd5mIO8iQDqwMdN2KilIhZJ5SFmPhDSXNn53QF1P26XUMW/SKTEMbA7zZtCdexQAqj S58mwDVquZdzj5PSS61zS21N0XYXGUTg7vEf51X6YXiB1CXCmtqgnYGeiyasXPgWQ2Q4 3g== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 33c23r0rnf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 09 Sep 2020 09:45:42 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0899eMW8175226; Wed, 9 Sep 2020 09:45:42 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 33cmkxfnwa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Sep 2020 09:45:42 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0899jeC6001233; Wed, 9 Sep 2020 09:45:41 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 09 Sep 2020 02:45:40 -0700 Date: Wed, 9 Sep 2020 12:45:28 +0300 From: Dan Carpenter To: Herbert Xu Cc: "David S. Miller" , Tero Kristo , Keerthy , linux-crypto@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] crypto: sa2ul - Fix pm_runtime_get_sync() error checking Message-ID: <20200909094528.GB420136@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9738 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009090086 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9738 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 priorityscore=1501 mlxlogscore=999 mlxscore=0 bulkscore=0 suspectscore=0 spamscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 clxscore=1011 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009090086 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The pm_runtime_get_sync() function returns either 0 or 1 on success but this code treats a return of 1 as a failure. Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver") Signed-off-by: Dan Carpenter --- drivers/crypto/sa2ul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c index acabb8ddacb6..604798c65e85 100644 --- a/drivers/crypto/sa2ul.c +++ b/drivers/crypto/sa2ul.c @@ -2333,7 +2333,7 @@ static int sa_ul_probe(struct platform_device *pdev) pm_runtime_enable(dev); ret = pm_runtime_get_sync(dev); - if (ret) { + if (ret < 0) { dev_err(&pdev->dev, "%s: failed to get sync: %d\n", __func__, ret); return ret; -- 2.28.0