Re: [PATCH RESEND] autofs: replace manual symlink buffer allocation in autofs_dir_symlink
Christian Brauner <[email protected]> Wed, 18 Mar 2026 10:56:34 +0100
| Newsgroups | gmane.linux.kernel,gmane.linux.kernel.autofs |
|---|---|
| Message-ID | <20260318-abheben-outen-81fc6549c319@brauner> |
On Wed, Mar 18, 2026 at 01:12:21AM +0100, Thorsten Blum wrote: > The symlink name was previously duplicated using an explicit kmalloc() > followed by strcpy(), which is deprecated [1]. Replace this open-coded > string duplication with kstrdup(), which allocates and copies the > symlink name with a single helper function. > > Remove the local variable 'size' and set 'i_size' directly using > strlen(cp), which is equivalent to the previous value of 'size'. > > This simplifies the code, uses common string-handling helpers, and > removes the deprecated use of strcpy(). > > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] > Acked-by: Ian Kent <[email protected]> > Signed-off-by: Thorsten Blum <[email protected]> > --- Ideally always Cc fsdevel. This way the tooling sees it right away.