Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\nlattr.c Create Date:2022-07-28 07:16:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:la_strdup - Copy string attribute payload into a newly allocated buffer*@nla: attribute to copy the string from*@flags: the type of memory to allocate (see kmalloc).* Returns a pointer to the allocated buffer or NULL on error.

Proto:char *nla_strdup(const struct nlattr *nla, gfp_t flags)

Type:char

Parameter:

TypeParameterName
const struct nlattr *nla
gfp_tflags
544  srclen = la_len - length of payload*@nla: netlink attribute
545  src = la_data - head of payload*@nla: netlink attribute
547  If srclen > 0 && src[srclen - 1] == '\0' Then srclen--
550  dst = kmalloc(srclen + 1, flags)
551  If (dst != NULL) Then
552  No 3D Now!(dst, src, srclen)
553  dst[srclen] = '\0'
555  Return dst