From patchwork Tue Aug 1 18:45:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 128319 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1759635vqg; Sun, 30 Jul 2023 19:34:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlF6kKabmHyZFKWi5Pj0F3LdXfXr8s/z/4YjLus2iPgKehWdfc484mmHcnN1h2sqDpn9RJ/U X-Received: by 2002:a05:6a00:14d1:b0:63d:260d:f9dd with SMTP id w17-20020a056a0014d100b0063d260df9ddmr9390499pfu.33.1690770839703; Sun, 30 Jul 2023 19:33:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690770839; cv=none; d=google.com; s=arc-20160816; b=XEdin4HVs5wUXuMwMnKyXjfK3PV8jjWW9tkky7eE2nf6o3la9WBSEzXM0+8b9hoJae +nKrDObQc1+bUKO0Nwlcps0Ap8GOy8McUhs4sAe7UL5l6P4/3Mc/0yEEUcG79OEKJVU5 39qKUArwpIU0txbYmo4/IuMHOYRGPxcISWEOP6qxAHm9y9jEiFaYgUE4LsJBbOuS8by3 JMWLhB69aLzcuiyBNL+37kGHRymaFw5spRwzplXn4ybjVRFeHgtYsiQ9QauRPUkIdk5I W6bOuagV8xM/wS3v6+N3HgGeRH7dlLPfSOtdqZ0/RrxsCkH14SQxrTypM/IpGEFiDXxs VP5Q== 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:from; bh=LBPmuMovzqV38hkkcYVBc+7kPC5nfGS6uf1xJlEnW2c=; fh=8YsxSnxpz/KQFQs6MEa7yS7nPT4hxXOEL1me/BFcztM=; b=XfGKJrbM3hNhcFRPGt6vMu7nDtDuytBj0I5NKdP0qWYpBvTCS6BJlNBrM2YKNPcAUi sdYCu8a7iQu8Zj3EZCOc/R7s5lRAYc69ccV20tXpFY2dLxdnMzAbGKc099F6oYIb/fDP ZP5ICvVwQXZ/b2qg3w5dpwR+pUkV9vG8eBGdqXD193DjsTiW7veRwovezCdXE3kd8cYK Kwm2kA/wUEw5kocFwvSeJrAhSDatFWRm1WAuebfeXDTtCmTP0u8OG6Ne7Ws85rs+/njO r+D4MmX0FJTBzly/XrhxP2BkVwWyl5dd76R4CnLFgINCcVeM4f7vPASYkL63WZni0HM4 sZnw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020a056a00244d00b0068254b9108bsi6645074pfj.71.2023.07.30.19.33.46; Sun, 30 Jul 2023 19:33:59 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229673AbjGaCOg (ORCPT + 99 others); Sun, 30 Jul 2023 22:14:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjGaCOe (ORCPT ); Sun, 30 Jul 2023 22:14:34 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 7190619C for ; Sun, 30 Jul 2023 19:14:33 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 459696025D44E; Mon, 31 Jul 2023 10:14:07 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: paul@paul-moore.com, brauner@kernel.org, fred@cloudflare.com, kpsingh@kernel.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_map=5Fwrite?= Date: Wed, 2 Aug 2023 02:45:12 +0800 Message-Id: <20230801184512.2892-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RCVD_IN_DNSWL_BLOCKED,RDNS_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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: INBOX X-GMAIL-THRID: 1772901723954133889 X-GMAIL-MSGID: 1772901723954133889 kbuf is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li zeming Reviewed-by: Randy Dunlap --- 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 1d8e47bed3f1..6fabf388bb8a 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 */