]> www.infradead.org Git - users/willy/xarray.git/commit
net: don't use input buffer of __dev_alloc_name() as a scratch space
authorJakub Kicinski <kuba@kernel.org>
Mon, 23 Oct 2023 15:23:41 +0000 (08:23 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 24 Oct 2023 20:02:58 +0000 (13:02 -0700)
commitbd07063dd11f6fda903802a5868960be3690d327
tree74f0a0bf84d4649f6686d685b416b4826a320462
parentfb1c535b13b7fa013e70265535182638ef2f04d6
net: don't use input buffer of __dev_alloc_name() as a scratch space

Callers of __dev_alloc_name() want to pass dev->name as
the output buffer. Make __dev_alloc_name() not clobber
that buffer on failure, and remove the workarounds
in callers.

dev_alloc_name_ns() is now completely unnecessary.

The extra strscpy() added here will be gone by the end
of the patch series.

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20231023152346.3639749-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c