From patchwork Mon Jan 15 06:25:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 188033 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1529324dyc; Sun, 14 Jan 2024 22:26:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtnrWIxEFLlTos7ikBeKxVx+FuUxxKuv5iOcotyM0JtldJsvHhmigpmZy/BZ8tOg4Ldjqe X-Received: by 2002:a37:e301:0:b0:783:5368:dfe3 with SMTP id y1-20020a37e301000000b007835368dfe3mr3509971qki.0.1705299959978; Sun, 14 Jan 2024 22:25:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705299959; cv=none; d=google.com; s=arc-20160816; b=b1ZjpQiYvsPkrFBPQ0Ey2c+eEeEHXrApreAjdDlz1ppxTBNoqCwfr5AXJng1tNJ+HR AnL24MtJW74BzrnS5sGWIGrgB0YH+B6RoPJNyqNC3mGEsI1todWNnhv8jVt81uWvVkod BqJxXZC3ae1+PoEz0bK7G8nJ9zWrZeD9Njj4WseYS0QP+oiS11+VA5jL8TxjJX8IfwN/ DelOgJg/EJxcYufnUs35eBCVczuYGvN79JGGdem6VXqyDF8DgNS6o1qaXd2RDCwUxjzU Cfg+Alyf/AgdlIy6euPERTRJBxJbqEwmi5/ts9Qd+Hy1CpFfTsFiKAIZ2RWpJ+W8o9e4 WlkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=OnFRtUgbzl/uz9o4cO9kKlE+1P0hkrpJVpvZh0GW8Yo=; fh=xLdF9wIfJyjCaj3Qc5q9ZK3VBg26oZAGV3zJ9o5X7dA=; b=Wfwpl6i0aC+5vLdyaCFtcRxPd4e5wUNNgybVcpl7hgOVR7u6ziCxezNeWUDZFCtzrU 1MhoJUM/FJQwLvonM6r2RliFpWAtcRZRhhQ5D/ccgRRTyiiW/2B9aMRYqMjr0E88kQqG 8jKumDj8OaxUbsTgm5NcSGdrnr9GTkaXcAAltl2mB21uapn1x17cgamDeHXPtSh5oLz4 fz4nNwlBAMW1Obu2ZfjbFECRF6UN5tBABi4EgvZ6//yCx4Q/mULEV7wLLDSHlE22mSgN 7D9Hkfd/0oUPtksZU/43xDIaH0SJvJkK44CmzEAy/gE48tGKvR4ZF6XGtFq6Zz+NV/lH to4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25657-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25657-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m15-20020a05620a220f00b00781795e5a7fsi7143740qkh.718.2024.01.14.22.25.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 22:25:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25657-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25657-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25657-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C302F1C20FA1 for ; Mon, 15 Jan 2024 06:25:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C480E4428; Mon, 15 Jan 2024 06:25:39 +0000 (UTC) Received: from mail.nfschina.com (unknown [42.101.60.195]) by smtp.subspace.kernel.org (Postfix) with SMTP id E45ED5666 for ; Mon, 15 Jan 2024 06:25:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nfschina.com Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 450A36025325C; Mon, 15 Jan 2024 14:25:26 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: akpm@linux-foundation.org, rdunlap@infradead.org Cc: linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] =?utf-8?q?user=5Fnamespace=3A_Remove_unnecessary_=E2=80=98N?= =?utf-8?q?ULL=E2=80=99_values_from_kbuf?= Date: Mon, 15 Jan 2024 14:25:19 +0800 Message-Id: <20240115062519.31298-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788136610901660226 X-GMAIL-MSGID: 1788136610901660226 kbuf is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li zeming --- kernel/user_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c index 1d8e47bed3f11..6fabf388bb8a8 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c @@ -928,7 +928,7 @@ static ssize_t map_write(struct file *file, const char __user *buf, struct uid_gid_map new_map; unsigned idx; struct uid_gid_extent extent; - char *kbuf = NULL, *pos, *next_line; + char *kbuf, *pos, *next_line; ssize_t ret; /* Only allow < page size writes at the beginning of the file */