Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4558323ybl; Tue, 21 Jan 2020 23:54:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxQOihElT6kGG1SmziODECd9J/nHxTs6mOvmtu+53ThGnNYIlX8q1UoPG2lL+4vFAYiZOl2 X-Received: by 2002:aca:e106:: with SMTP id y6mr6054165oig.131.1579679667512; Tue, 21 Jan 2020 23:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579679667; cv=none; d=google.com; s=arc-20160816; b=Nhv1ZPeFXlXINwh1tZqaeLDhLhRjK/7nT7AGqh9eUicnwnvrnwvLyjrG0jb0mW4r8B dumaWBvJcQxXs1Sayh7/S10wgoIMzpM8B3zHwUTwoDvUTB2oHnJRAx1QgOo+RgXsSWAj Ak1T3RJaTMxXk1TUIFzAt/d+iSQRMmyIro9sCAROfOG+bh3SxJodc+P1gyYJQivjEFDD 2COVe8/69p/2q1JzNwzAq35B315VZX2CGCTHU/gCr3BVSixfKvBoZp3GWSz/NObyy0Y3 iGoLr7m3FtVmM7LcbA+5zVGr7r//3eWkbKSYhW3vW28Qq0BeAJ6T207fiM0Rwyiy5ZeY iW4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7SpNwGwT7vtbCEMcTAIThlS0YV28X15z7/I/FBSwsLg=; b=Y+sQ734OqsqB8+eDSk7URlYnSqePub0hRpB+Rl/LH508ySR2WVTj24Y4lT++1RLui7 CtRsQ+0Jk8sF7LBPKEqpdY3F44pjr1Eejo/aYd13MIy1At3h1jvTo3HpjA1Tw/uSLA6V TQfoX3Uu9mpEYkRlaR4vvypZOqN/u/JmMTv/tbhvY3Vnt/RM0HIVZnzN/nCs8hFbeJR9 r7EyxgQKwN75AeIWgZnz+D6Y9E84iRmhVSOsb2HxfoumC9g6H58z5bdz99LiTuwpN3Og EE4pPnBS7b9AtTNm/84+YaVZ7mfciV/HLLXH1s8am+Jjn3O6PTmMOWhgpLIx+eh3E0hz 6TqQ== 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 f81si21347101oig.110.2020.01.21.23.54.15; Tue, 21 Jan 2020 23:54:27 -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 S1729092AbgAVHxI (ORCPT + 99 others); Wed, 22 Jan 2020 02:53:08 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:57488 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726083AbgAVHxI (ORCPT ); Wed, 22 Jan 2020 02:53:08 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id AD14DC6E8B170EEAAC4C; Wed, 22 Jan 2020 15:53:05 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Wed, 22 Jan 2020 15:52:57 +0800 From: Wei Yongjun To: David Howells CC: Wei Yongjun , , Subject: [PATCH -next v2] watch_queue: fix error return code in watch_queue_set_size() Date: Wed, 22 Jan 2020 07:48:07 +0000 Message-ID: <20200122074807.10849-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200120085411.116252-1-weiyongjun1@huawei.com> References: <20200120085411.116252-1-weiyongjun1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: 009b0aa00c5a ("pipe: Add general notification queue support") Signed-off-by: Wei Yongjun --- kernel/watch_queue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c index f195cbbbb3d3..f1028761cb9c 100644 --- a/kernel/watch_queue.c +++ b/kernel/watch_queue.c @@ -251,6 +251,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes) if (ret < 0) goto error; + ret = -ENOMEM; pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL); if (!pages) goto error;