From patchwork Mon May 20 09:08:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fedor Pchelkin X-Patchwork-Id: 13668136 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43A68208A0; Mon, 20 May 2024 09:10:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716196213; cv=none; b=U1nYfwB642mM0eCzjALpHOZRY2gUXZChwyEVk1AZO5WYiOHVz55nILxlzKJE6sLQpmaiAhpmEdZNoN+tc4ZwgK3+CPkcCqX+jP+F9xy0ntjSH/Q8stqJvKn+7uyI846fw6dKyYtL7zkTum6wmOqUhTP5uULdkUkMenagT2Iy2Do= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716196213; c=relaxed/simple; bh=545Z9tkN34N0Dsh1Q1qIJ26oe7owU6dG5nZ3IvZTHz4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=UzQi+WamN/WOHJhNfVvZcm8vpuqsofZJF26ktCLec0ZLvlUNEwxjiSFNpFwHIaz5Q6arjEiWulBrOe0eTQyz103D0B3tbfb1DLImGRrGMrUffbh5Jlu4z89sga6RDPSdDLS1sfmRsd9ZyWRaeWxDDGQIfYA8o7d5pavvneIoPqk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=VX1XD5fH; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="VX1XD5fH" Received: from localhost.localdomain (unknown [5.228.116.47]) by mail.ispras.ru (Postfix) with ESMTPSA id 1046C407853B; Mon, 20 May 2024 09:10:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 1046C407853B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1716196201; bh=ITagZGQ3VHzpt1AUxt0LwozxAebgPmFLksDrhcMgLC8=; h=From:To:Cc:Subject:Date:From; b=VX1XD5fHx8v2bAF4FE179K/dueE5KZaWO5YqetmsajbMQTTHnHcsB1v2Y7OE1vsL5 RmH+FDOFJzdssBBoXv8Lz8IgsqQrVp71nBMfZFZr88CNq36dqUPV2Cp8ANun0wKtCp W7U8qCNUesiy1syEDlUVMWeIqi2wJPSw72t4xqcA= From: Fedor Pchelkin To: Jens Axboe , Christian Brauner Cc: Fedor Pchelkin , Alexander Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org Subject: [PATCH 1/2] signalfd: fix error return code Date: Mon, 20 May 2024 12:08:18 +0300 Message-Id: <20240520090819.76342-1-pchelkin@ispras.ru> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If anon_inode_getfile() fails, return appropriate error code. This looks like a single typo: the similar code changes in timerfd and userfaultfd are okay. Found by Linux Verification Center (linuxtesting.org). Fixes: fbe38120eb1d ("signalfd: convert to ->read_iter()") Signed-off-by: Fedor Pchelkin Reviewed-by: Jens Axboe --- fs/signalfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/signalfd.c b/fs/signalfd.c index 4a5614442dbf..65fe5eed0be4 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -282,7 +282,7 @@ static int do_signalfd4(int ufd, sigset_t *mask, int flags) if (IS_ERR(file)) { put_unused_fd(ufd); kfree(ctx); - return ufd; + return PTR_ERR(file); } file->f_mode |= FMODE_NOWAIT;