{"schema_version":"1.9.0","id":"CVE-2022-50513","published":"2025-10-07T15:19:09.547Z","modified":"2026-08-12T03:51:08.621172740Z","related":["SUSE-SU-2025:4111-1","SUSE-SU-2025:4135-1","SUSE-SU-2025:4139-1","SUSE-SU-2025:4149-1","SUSE-SU-2025:4188-1","SUSE-SU-2025:4320-1"],"summary":"staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nstaging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()\n\nIn rtw_init_cmd_priv(), if `pcmdpriv->rsp_allocated_buf` is allocated\nin failure, then `pcmdpriv->cmd_allocated_buf` will be not properly\nreleased. Besides, considering there are only two error paths and the\nfirst one can directly return, so we do not need implicitly jump to the\n`exit` tag to execute the error handler.\n\nSo this patch added `kfree(pcmdpriv->cmd_allocated_buf);` on the error\npath to release the resource and simplified the return logic of\nrtw_init_cmd_priv(). As there is no proper device to test with, no runtime\ntesting was performed.","affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"554c0a3abf216c991c5ebddcdb2c08689ecd290b"},{"fixed":"e5d8f05edb36fc4ab15beec62cb6ab62f5a60fe2"},{"fixed":"e6cc39db24a63f68314473621020ed8cad7be423"},{"fixed":"39bef9c6a91bbb790d04c1347cfeae584541fb6a"},{"fixed":"a5be64ff6d21f7805a91e6d81f53fc19cd9f0fae"},{"fixed":"8db6ca84eee0ac258706f3fca54f7c021cb159ef"},{"fixed":"708056fba733a73d926772ea4ce9a42d240345da"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50513.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.12.0"},{"fixed":"5.4.220"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.150"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.75"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"5.19.17"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.20.0"},{"fixed":"6.0.3"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50513.json"}}],"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/39bef9c6a91bbb790d04c1347cfeae584541fb6a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/708056fba733a73d926772ea4ce9a42d240345da"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8db6ca84eee0ac258706f3fca54f7c021cb159ef"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a5be64ff6d21f7805a91e6d81f53fc19cd9f0fae"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e5d8f05edb36fc4ab15beec62cb6ab62f5a60fe2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e6cc39db24a63f68314473621020ed8cad7be423"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50513.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50513"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50513.json"}}