mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 65 participants
  • 18416 discussions
Re: [PATCH OLK-5.10] x86/config: enable btrfs feature
by Xie XiuQi 13 Dec '21

13 Dec '21
Hi, Thanks for your patch. Please subscribe the kernel(a)openeuler.org and kernel-discuss(a)openeuler.org mailing list before sending patches, or your patches would be blocked. Others could not receive your email. Please resend this patch. On 2021/12/13 15:11, Jiao Fenfang wrote: > From: JiaoFenfang <jiaofenfang(a)uniontech.com> > > openEuler inclusion > category: feature > bugzilla: https://gitee.com/openeuler/kernel/issues/I4KVP7?from=project-issue > Add commit message here. > Signed-off-by: Jiao Fenfang <jiaofenfang(a)uniontech.com> > --- > arch/x86/configs/openeuler_defconfig | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > Also enable it on arm64 platform? > diff --git a/arch/x86/configs/openeuler_defconfig b/arch/x86/configs/openeuler_defconfig > index 7b608301823c..01a902eba3b9 100644 > --- a/arch/x86/configs/openeuler_defconfig > +++ b/arch/x86/configs/openeuler_defconfig > @@ -7451,7 +7451,13 @@ CONFIG_XFS_POSIX_ACL=y > CONFIG_GFS2_FS=m > CONFIG_GFS2_FS_LOCKING_DLM=y > # CONFIG_OCFS2_FS is not set > -# CONFIG_BTRFS_FS is not set > +CONFIG_BTRFS_FS=m > +# CONFIG_BTRFS_FS_POSIX_ACL is not set > +# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set > +# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set > +# CONFIG_BTRFS_DEBUG is not set > +# CONFIG_BTRFS_ASSERT is not set > +# CONFIG_BTRFS_FS_REF_VERIFY is not set > # CONFIG_NILFS2_FS is not set > # CONFIG_F2FS_FS is not set > # CONFIG_ZONEFS_FS is not set >
1 0
0 0
[PATCH openEuler-1.0-LTS] ixgbe: fix large MTU request from VF
by Yang Yingliang 13 Dec '21

13 Dec '21
From: Jesse Brandeburg <jesse.brandeburg(a)intel.com> mainline inclusion from mainline-v5.13-rc4 commit 63e39d29b3da02e901349f6cd71159818a4737a6 category: bugfix bugzilla: NA CVE: CVE-2021-33098 ----------------------------------------------- Check that the MTU value requested by the VF is in the supported range of MTUs before attempting to set the VF large packet enable, otherwise reject the request. This also avoids unnecessary register updates in the case of the 82599 controller. Fixes: 872844ddb9e4 ("ixgbe: Enable jumbo frames support w/ SR-IOV") Co-developed-by: Piotr Skajewski <piotrx.skajewski(a)intel.com> Signed-off-by: Piotr Skajewski <piotrx.skajewski(a)intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg(a)intel.com> Co-developed-by: Mateusz Palczewski <mateusz.palczewski(a)intel.com> Signed-off-by: Mateusz Palczewski <mateusz.palczewski(a)intel.com> Tested-by: Konrad Jankowski <konrad0.jankowski(a)intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen(a)intel.com> Signed-off-by: David S. Miller <davem(a)davemloft.net> Signed-off-by: Huang Guobin <huangguobin4(a)huawei.com> Reviewed-by: Wei Yongjun <weiyongjun1(a)huawei.com> Reviewed-by: Xiu Jianfeng <xiujianfeng(a)huawei.com> Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index f6ffd9fb20793..8aaf856771d7b 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c @@ -467,12 +467,16 @@ static int ixgbe_set_vf_vlan(struct ixgbe_adapter *adapter, int add, int vid, return err; } -static s32 ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) +static int ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 max_frame, u32 vf) { struct ixgbe_hw *hw = &adapter->hw; - int max_frame = msgbuf[1]; u32 max_frs; + if (max_frame < ETH_MIN_MTU || max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE) { + e_err(drv, "VF max_frame %d out of range\n", max_frame); + return -EINVAL; + } + /* * For 82599EB we have to keep all PFs and VFs operating with * the same max_frame value in order to avoid sending an oversize @@ -532,12 +536,6 @@ static s32 ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) } } - /* MTU < 68 is an error and causes problems on some kernels */ - if (max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE) { - e_err(drv, "VF max_frame %d out of range\n", max_frame); - return -EINVAL; - } - /* pull current max frame size from hardware */ max_frs = IXGBE_READ_REG(hw, IXGBE_MAXFRS); max_frs &= IXGBE_MHADD_MFS_MASK; @@ -1240,7 +1238,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) retval = ixgbe_set_vf_vlan_msg(adapter, msgbuf, vf); break; case IXGBE_VF_SET_LPE: - retval = ixgbe_set_vf_lpe(adapter, msgbuf, vf); + retval = ixgbe_set_vf_lpe(adapter, msgbuf[1], vf); break; case IXGBE_VF_SET_MACVLAN: retval = ixgbe_set_vf_macvlan_msg(adapter, msgbuf, vf); -- 2.25.1
1 0
0 0
Re: [PATCH] vfio/iommu_type1: replace kfree with kvfree
by Xie XiuQi 13 Dec '21

13 Dec '21
Hi, Thanks for your patch. Please subscribe the kernel(a)openeuler.org and kernel-discuss(a)openeuler.org mailing list before sending patches, or your patches would be blocked. Please resend this patch, and specific the right branch. Welcome to start a topic at openEuler kernel sig meeting via seeding mail to kernel-discuss(a)openeuler.org. --- 可以通过openEuler kernel 小助手,参加openEuler kernel SIG 微信群。 https://openeuler.gitee.io/kernel-portal/img/wechat/openEuler_kernel_helper… On 2021/12/12 18:14, Jiacheng Shi wrote: > From: billsjchw <billsjc(a)126.com> > > Variables allocated by kvmalloc should not be freed by kfree. > Because they may be allocated by vmalloc. > So we replace kfree with kvfree here. > > Signed-off-by: Jiacheng Shi <billsjc(a)sjtu.edu.cn> > --- > drivers/vfio/vfio_iommu_type1.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c > index 5daceec48811..6811a85109aa 100644 > --- a/drivers/vfio/vfio_iommu_type1.c > +++ b/drivers/vfio/vfio_iommu_type1.c > @@ -1150,7 +1150,7 @@ static int vfio_iova_dirty_log_clear(u64 __user *bitmap, > } > > out: > - kfree(bitmap_buffer); > + kvfree(bitmap_buffer); > return ret; > } > >
1 0
0 0
[PATCH master] staging: r8188eu: fix a memory leak in rtw_mp_QueryDrv()
by Jianglei Nie 12 Dec '21

12 Dec '21
stable inclusion category: bugfix bugzilla: NA CVE: NA Line 6191 (#1) allocates a memory chunk for input by kmalloc(). Line 6213 (#3) frees the input before the function returns while line 6199 (#2) forget to free it, which will lead to a memory leak. This bug influences all stable versions from 5.15.1 to 5.15.7. We should kfree() input in line 6199 (#2). 6186 static int rtw_mp_QueryDrv(struct net_device *dev, 6187 struct iw_request_info *info, 6188 union iwreq_data *wrqu, char *extra) 6189 { 6191 char *input = kmalloc(wrqu->data.length, GFP_KERNEL); // #1: kmalloc space 6195 if (!input) 6196 return -ENOMEM; 6198 if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) 6199 return -EFAULT; // #2: missing kfree 6213 kfree(input); // #3: kfree space 6214 return 0; 6215 } Signed-off-by: Jianglei Nie <niejianglei2021(a)163.com> --- drivers/staging/r8188eu/os_dep/ioctl_linux.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c index 906a57eae1af..edc660f15436 100644 --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c @@ -6195,8 +6195,11 @@ static int rtw_mp_QueryDrv(struct net_device *dev, if (!input) return -ENOMEM; - if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) - return -EFAULT; + if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) { + kfree(input); + return -EFAULT; + } + DBG_88E("%s:iwpriv in =%s\n", __func__, input); qAutoLoad = strncmp(input, "autoload", 8); /* strncmp true is 0 */ -- 2.25.1
1 0
0 0
[PATCH master] staging: r8188eu: fix a memory leak in rtw_mp_pwrtrk()
by Jianglei Nie 12 Dec '21

12 Dec '21
stable inclusion category: bugfix bugzilla: NA CVE: NA Line 5968 (#1) allocates a memory chunk for input by kmalloc(). Line 5973 (#2), line 5989 (#4) and line 5994 (#5) free the input before the function returns while line 5986 (#3) forget to free it, which will lead to a memory leak. This bug influences all stable versions from 5.15 to 5.15.7. We should kfree() input in line 5986 (#3). 5960 static int rtw_mp_pwrtrk(struct net_device *dev, 5961 struct iw_request_info *info, 5962 struct iw_point *wrqu, char *extra) 5963 { 5968 char *input = kmalloc(wrqu->length, GFP_KERNEL); // #1: kmalloc space 5970 if (!input) 5971 return -ENOMEM; 5972 if (copy_from_user(input, wrqu->pointer, wrqu->length)) { 5973 kfree(input); // #2: kfree space 5974 return -EFAULT; 5975 } 5980 if (strncmp(input, "stop", 4) == 0) { 5981 enable = 0; 5982 sprintf(extra, "mp tx power tracking stop"); 5983 } else if (sscanf(input, "ther =%d", &thermal)) { 5984 ret = Hal_SetThermalMeter(padapter, (u8)thermal); 5985 if (ret == _FAIL) 5986 return -EPERM; // #3: missing kfree 5987 sprintf(extra, "mp tx power tracking start, target value =%d ok ", thermal); 5988 } else { 5989 kfree(input); // #4: kfree space 5990 return -EINVAL; 5991 } 5994 kfree(input); // #5: kfree space 6000 return 0; 6001 } Signed-off-by: Jianglei Nie <niejianglei2021(a)163.com> --- drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c index 0eccce57c63a..906a57eae1af 100644 --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c @@ -5982,8 +5982,10 @@ static int rtw_mp_pwrtrk(struct net_device *dev, sprintf(extra, "mp tx power tracking stop"); } else if (sscanf(input, "ther =%d", &thermal)) { ret = Hal_SetThermalMeter(padapter, (u8)thermal); - if (ret == _FAIL) + if (ret == _FAIL) { + kfree(input); return -EPERM; + } sprintf(extra, "mp tx power tracking start, target value =%d ok ", thermal); } else { kfree(input); -- 2.25.1
1 0
0 0
[PATCH master] powercap: DTPM: Fix reference leak in cpuhp_dtpm_cpu_offline()
by Jianglei Nie 12 Dec '21

12 Dec '21
stable inclusion category: bugfix bugzilla: NA CVE: NA In line 153 (#1), cpufreq_cpu_get() increments the kobject reference counter of the policy it returned on success. According to the document, the policy returned by cpufreq_cpu_get() has to be released with the help of cpufreq_cpu_put() to balance its kobject reference counter properly. Forgetting the cpufreq_cpu_put() operation will result in reference leak.This bug influences all stable versions from v5.15 to v5.15.7. We can fix it by calling cpufreq_cpu_put() before the function returns (#2, #3 and #4). 147 static int cpuhp_dtpm_cpu_offline(unsigned int cpu) 148 { 153 policy = cpufreq_cpu_get(cpu); // #1: reference increment 155 if (!policy) 156 return 0; 158 pd = em_cpu_get(cpu); 159 if (!pd) 160 return -EINVAL; // #2: missing reference decrement 166 if (cpumask_weight(policy->cpus) != 1) 167 return 0; // #3: missing reference decrement 174 return 0; // #4: missing reference decrement 175 } Signed-off-by: Jianglei Nie <niejianglei2021(a)163.com> --- drivers/powercap/dtpm_cpu.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c index 51c366938acd..6c94515b21ef 100644 --- a/drivers/powercap/dtpm_cpu.c +++ b/drivers/powercap/dtpm_cpu.c @@ -156,21 +156,25 @@ static int cpuhp_dtpm_cpu_offline(unsigned int cpu) return 0; pd = em_cpu_get(cpu); - if (!pd) + if (!pd) { + cpufreq_cpu_put(policy); return -EINVAL; + } dtpm = per_cpu(dtpm_per_cpu, cpu); power_sub(dtpm, pd); - if (cpumask_weight(policy->cpus) != 1) + if (cpumask_weight(policy->cpus) != 1) { + cpufreq_cpu_put(policy); return 0; + } for_each_cpu(cpu, policy->related_cpus) per_cpu(dtpm_per_cpu, cpu) = NULL; dtpm_unregister(dtpm); - + cpufreq_cpu_put(policy); return 0; } -- 2.25.1
1 0
0 0
[PATCH master] security:trusted_tpm2: Fix memory leak in tpm2_key_encode()
by Jianglei Nie 12 Dec '21

12 Dec '21
openEuler inclusion category: bugfix bugzilla: NA CVE: NA Line 36 (#1) allocates a memory chunk for scratch by kmalloc(), but it is never freed through the function, which will lead to a memory leak. We should kfree() scratch before the function returns (#2, #3 and #4). 31 static int tpm2_key_encode(struct trusted_key_payload *payload, 32 struct trusted_key_options *options, 33 u8 *src, u32 len) 34 { 36 u8 *scratch = kmalloc(SCRATCH_SIZE, GFP_KERNEL); // #1: kmalloc space 37 u8 *work = scratch, *work1; 50 if (!scratch) 51 return -ENOMEM; 56 if (options->blobauth_len == 0) { 60 if (WARN(IS_ERR(w), "BUG: Boolean failed to encode")) 61 return PTR_ERR(w); // #2: missing kfree 63 } 71 if (WARN(work - scratch + pub_len + priv_len + 14 > SCRATCH_SIZE, 72 "BUG: scratch buffer is too small")) 73 return -EINVAL; // #3: missing kfree // #4: missing kfree: scratch is never used afterwards. 82 if (WARN(IS_ERR(work1), "BUG: ASN.1 encoder failed")) 83 return PTR_ERR(work1); 85 return work1 - payload->blob; 86 } Signed-off-by: Jianglei Nie <niejianglei2021(a)163.com> --- security/keys/trusted-keys/trusted_tpm2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/security/keys/trusted-keys/trusted_tpm2.c b/security/keys/trusted-keys/trusted_tpm2.c index 0165da386289..3408a74c855f 100644 --- a/security/keys/trusted-keys/trusted_tpm2.c +++ b/security/keys/trusted-keys/trusted_tpm2.c @@ -57,8 +57,10 @@ static int tpm2_key_encode(struct trusted_key_payload *payload, unsigned char bool[3], *w = bool; /* tag 0 is emptyAuth */ w = asn1_encode_boolean(w, w + sizeof(bool), true); - if (WARN(IS_ERR(w), "BUG: Boolean failed to encode")) + if (WARN(IS_ERR(w), "BUG: Boolean failed to encode")) { + kfree(scratch); return PTR_ERR(w); + } work = asn1_encode_tag(work, end_work, 0, bool, w - bool); } @@ -69,9 +71,12 @@ static int tpm2_key_encode(struct trusted_key_payload *payload, * trigger, so if it does there's something nefarious going on */ if (WARN(work - scratch + pub_len + priv_len + 14 > SCRATCH_SIZE, - "BUG: scratch buffer is too small")) + "BUG: scratch buffer is too small")) { + kfree(scratch); return -EINVAL; + } + kfree(scratch); work = asn1_encode_integer(work, end_work, options->keyhandle); work = asn1_encode_octet_string(work, end_work, pub, pub_len); work = asn1_encode_octet_string(work, end_work, priv, priv_len); -- 2.25.1
1 0
0 0
[PATCH master] btrfs: Fix memory leak in __add_inode_ref()
by Jianglei Nie 12 Dec '21

12 Dec '21
openEuler inclusion category: bugfix bugzilla: NA CVE: NA Line 1169 (#3) allocates a memory chunk for victim_name by kmalloc(), but when the function returns in line 1184 (#4) victim_name allcoated by line 1169 (#3) is not freed, which will lead to a memory leak. There is a similar snippet of code in this function as allocating a memory chunk for victim_name in line 1104 (#1) as well as releasing the memory in line 1116 (#2). We should kfree() victim_name when the return value of backref_in_log() is less than zero and before the function returns in line 1184 (#4). 1057 static inline int __add_inode_ref(struct btrfs_trans_handle *trans, 1058 struct btrfs_root *root, 1059 struct btrfs_path *path, 1060 struct btrfs_root *log_root, 1061 struct btrfs_inode *dir, 1062 struct btrfs_inode *inode, 1063 u64 inode_objectid, u64 parent_objectid, 1064 u64 ref_index, char *name, int namelen, 1065 int *search_done) 1066 { 1104 victim_name = kmalloc(victim_name_len, GFP_NOFS); // #1: kmalloc (victim_name-1) 1105 if (!victim_name) 1106 return -ENOMEM; 1112 ret = backref_in_log(log_root, &search_key, 1113 parent_objectid, victim_name, 1114 victim_name_len); 1115 if (ret < 0) { 1116 kfree(victim_name); // #2: kfree (victim_name-1) 1117 return ret; 1118 } else if (!ret) { 1169 victim_name = kmalloc(victim_name_len, GFP_NOFS); // #3: kmalloc (victim_name-2) 1170 if (!victim_name) 1171 return -ENOMEM; 1180 ret = backref_in_log(log_root, &search_key, 1181 parent_objectid, victim_name, 1182 victim_name_len); 1183 if (ret < 0) { 1184 return ret; // #4: missing kfree (victim_name-2) 1185 } else if (!ret) { 1241 return 0; 1242 } Signed-off-by: Jianglei Nie <niejianglei2021(a)163.com> --- fs/btrfs/tree-log.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 8ab33caf016f..d373fec55521 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -1181,6 +1181,7 @@ static inline int __add_inode_ref(struct btrfs_trans_handle *trans, parent_objectid, victim_name, victim_name_len); if (ret < 0) { + kfree(victim_name); return ret; } else if (!ret) { ret = -ENOENT; -- 2.25.1
1 0
0 0
[PATCH master] scsi: csiostor: Fix memory leak in csio_wr_eq_destroy()
by Jianglei Nie 12 Dec '21

12 Dec '21
openEuler inclusion category: bugfix bugzilla: NA CVE: NA Line 715 (#1) calls mempool_alloc() to allocate an element from a specific memory pool. When some errors occur, line 727 (#2) frees this memory pool but line 731 (#3) does not free it, which will lead to a memory leak. We can fix it by calling mempool_free() when the cbfn is not equal to NULL and before the function returns 0 in line 732 (#3). 705 static int 706 csio_wr_eq_destroy(struct csio_hw *hw, void *priv, int eq_idx, 707 void (*cbfn) (struct csio_hw *, struct csio_mb *)) 708 { 710 struct csio_mb *mbp; 715 mbp = mempool_alloc(hw->mb_mempool, GFP_ATOMIC); // #1: allocate memory pool 716 if (!mbp) 717 return -ENOMEM; 725 rv = csio_mb_issue(hw, mbp); 726 if (rv != 0) { 727 mempool_free(mbp, hw->mb_mempool); // #2: free memory pool 728 return rv; 729 } 731 if (cbfn != NULL) 732 return 0; // #3: missing free 734 return csio_wr_eq_destroy_rsp(hw, mbp, eq_idx); 735 } Signed-off-by: Jianglei Nie <niejianglei2021(a)163.com> --- drivers/scsi/csiostor/csio_wr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/csiostor/csio_wr.c b/drivers/scsi/csiostor/csio_wr.c index fe0355c964bc..7dcc4fda0483 100644 --- a/drivers/scsi/csiostor/csio_wr.c +++ b/drivers/scsi/csiostor/csio_wr.c @@ -728,8 +728,10 @@ csio_wr_eq_destroy(struct csio_hw *hw, void *priv, int eq_idx, return rv; } - if (cbfn != NULL) + if (cbfn != NULL) { + mempool_free(mbp, hw->mb_mempool); return 0; + } return csio_wr_eq_destroy_rsp(hw, mbp, eq_idx); } -- 2.25.1
1 0
0 0
[PATCH master] drm/amdgpu: Fix reference leak in psp_xgmi_reflect_topology_info()
by Jianglei Nie 12 Dec '21

12 Dec '21
openEuler inclusion category: bugfix bugzilla: NA CVE: NA In line 1138 (#1), amdgpu_get_xgmi_hive() increases the kobject reference counter of the hive it returned. The hive returned by amdgpu_get_xgmi_hive() should be released with the help of amdgpu_put_xgmi_hive() to balance its kobject reference counter properly. Forgetting the amdgpu_put_xgmi_hive() operation will result in reference leak. We can fix it by calling amdgpu_put_xgmi_hive() before the end of the function (#2). 1128 static void psp_xgmi_reflect_topology_info(struct psp_context *psp, 1129 struct psp_xgmi_node_info node_info) 1130 { 1138 hive = amdgpu_get_xgmi_hive(psp->adev); // #1: kzalloc space reference increment 1139 list_for_each_entry(mirror_adev, &hive->device_list, gmc.xgmi.head) { 1140 struct psp_xgmi_topology_info *mirror_top_info; 1141 int j; 1143 if (mirror_adev->gmc.xgmi.node_id != dst_node_id) 1144 continue; 1146 mirror_top_info = &mirror_adev->psp.xgmi_context.top_info; 1147 for (j = 0; j < mirror_top_info->num_nodes; j++) { 1148 if (mirror_top_info->nodes[j].node_id != src_node_id) 1149 continue; 1151 mirror_top_info->nodes[j].num_hops = dst_num_hops; 1157 if (dst_num_links) 1158 mirror_top_info->nodes[j].num_links = dst_num_links; 1160 break; 1161 } 1163 break; 1164 } // #2: missing reference decrement 1165 } Signed-off-by: Jianglei Nie <niejianglei2021(a)163.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index c641f84649d6..f6362047ed71 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -1162,6 +1162,7 @@ static void psp_xgmi_reflect_topology_info(struct psp_context *psp, break; } + amdgpu_put_xgmi_hive(hive); } int psp_xgmi_get_topology_info(struct psp_context *psp, -- 2.25.1
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 1666
  • 1667
  • 1668
  • 1669
  • 1670
  • 1671
  • 1672
  • ...
  • 1842
  • Older →

HyperKitty Powered by HyperKitty