{"id":"CVE-2022-50282","summary":"chardev: fix error handling in cdev_device_add()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nchardev: fix error handling in cdev_device_add()\n\nWhile doing fault injection test, I got the following report:\n\n------------[ cut here ]------------\nkobject: '(null)' (0000000039956980): is not initialized, yet kobject_put() is being called.\nWARNING: CPU: 3 PID: 6306 at kobject_put+0x23d/0x4e0\nCPU: 3 PID: 6306 Comm: 283 Tainted: G        W          6.1.0-rc2-00005-g307c1086d7c9 #1253\nHardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014\nRIP: 0010:kobject_put+0x23d/0x4e0\nCall Trace:\n \u003cTASK\u003e\n cdev_device_add+0x15e/0x1b0\n __iio_device_register+0x13b4/0x1af0 [industrialio]\n __devm_iio_device_register+0x22/0x90 [industrialio]\n max517_probe+0x3d8/0x6b4 [max517]\n i2c_device_probe+0xa81/0xc00\n\nWhen device_add() is injected fault and returns error, if dev-\u003edevt is not set,\ncdev_add() is not called, cdev_del() is not needed. Fix this by checking dev-\u003edevt\nin error path.","modified":"2026-11-13T04:01:52.029590056Z","published":"2025-09-15T14:21:18.658Z","related":["SUSE-SU-2025:03614-1","SUSE-SU-2025:03615-1","SUSE-SU-2025:03628-1","SUSE-SU-2025:3716-1","SUSE-SU-2025:3761-1","SUSE-SU-2026:0350-1","SUSE-SU-2026:0369-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50282.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/11fa7fefe3d8fac7da56bc9aa3dd5fb3081ca797"},{"type":"WEB","url":"https://git.kernel.org/stable/c/28dc61cc49c6e995121c6d86bef4b73df78dda80"},{"type":"WEB","url":"https://git.kernel.org/stable/c/34d17b39bceef25e4cf9805cd59250ae05d0a139"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5d2146889fad4cb9e6c13e790d4cfd871486eca8"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6acf8597c5b04f455ee0649e11e5f3bcd28f381e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/85a5660491b507d33662b8e81c142e6041e642eb"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b5de1eac71fec1af7723f1083d23a24789fd795c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c46db6088bccff5115674d583fef46ede80077a2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d85b5247a79355b8432bfd9ac871f96117f750d4"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50282.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50282"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"da97a80a657d1b1b50ef633e8ff5dbf0d417fc8d"},{"fixed":"5d2146889fad4cb9e6c13e790d4cfd871486eca8"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"233ed09d7fdacf592ee91e6c97ce5f4364fbe7c0"},{"fixed":"6acf8597c5b04f455ee0649e11e5f3bcd28f381e"},{"fixed":"34d17b39bceef25e4cf9805cd59250ae05d0a139"},{"fixed":"d85b5247a79355b8432bfd9ac871f96117f750d4"},{"fixed":"c46db6088bccff5115674d583fef46ede80077a2"},{"fixed":"28dc61cc49c6e995121c6d86bef4b73df78dda80"},{"fixed":"b5de1eac71fec1af7723f1083d23a24789fd795c"},{"fixed":"85a5660491b507d33662b8e81c142e6041e642eb"},{"fixed":"11fa7fefe3d8fac7da56bc9aa3dd5fb3081ca797"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"f78b54e7d83c7879f9a6e49e6724019ca34177cc"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"d79d7d5c878809964da537336dad5ff55fa1605e"}]}],"versions":["v4.9.336","v4.9.335","v4.9.334","v4.9.333","v4.9.332","v4.9.331","v4.9.330","v4.9.329","v4.9.328","v4.9.327","v4.9.326","v4.9.325","v4.9.324","v4.9.323","v4.9.322","v4.9.321","v4.9.320","v4.9.319","v4.9.318","v4.9.317","v4.9.316","v4.9.315","v4.9.314","v4.9.313","v4.9.312","v4.9.311","v4.9.310","v4.9.309","v4.9.308","v4.9.307","v4.9.306","v4.9.305","v4.9.304","v4.9.303","v4.9.302","v4.9.301","v4.9.300","v4.9.299","v4.9.298","v4.9.297","v4.9.296","v4.9.295","v4.9.294","v4.9.293","v4.9.292","v4.9.291","v4.9.290","v4.9.289","v4.9.288","v4.9.287","v4.9.286","v4.9.285","v4.9.284","v4.9.283","v4.9.282","v4.9.281","v4.9.280","v4.9.279","v4.9.278","v4.9.277","v4.9.276","v4.9.275","v4.9.274","v4.9.273","v4.9.272","v4.9.271","v4.9.270","v4.9.269","v4.9.268","v4.9.267","v4.9.266","v4.9.265","v4.9.264","v4.9.263","v4.9.262","v4.9.261","v4.9.260","v4.9.259","v4.9.258","v4.9.257","v4.9.256","v4.9.255","v4.9.254","v4.9.253","v4.9.252","v4.9.251","v4.9.250","v4.9.249","v4.9.248","v4.9.247","v4.9.246","v4.9.245","v4.9.244","v4.9.243","v4.9.242","v4.9.241","v4.9.240","v4.9.239","v4.9.238","v4.9.237","v4.9.236","v4.9.235","v4.9.234","v4.9.233","v4.9.232","v4.9.231","v4.9.230","v4.9.229","v4.9.228","v4.9.227","v4.9.226","v4.9.225","v4.9.224","v3.16.85","v3.16.84","v3.16.83","v4.4.302","v4.4.301","v4.4.300","v4.4.299","v4.4.298","v4.4.297","v4.4.296","v4.4.295","v4.4.294","v4.4.293","v4.4.292","v4.4.291","v4.4.290","v4.4.289","v4.4.288","v4.4.287","v4.4.286","v4.4.285","v4.4.284","v4.4.283","v4.4.282","v4.4.281","v4.4.280","v4.4.279","v4.4.278","v4.4.277","v4.4.276","v4.4.275","v4.4.274","v4.4.273","v4.4.272","v4.4.271","v4.4.270","v4.4.269","v4.4.268","v4.4.267","v4.4.266","v4.4.265","v4.4.264","v4.4.263","v4.4.262","v4.4.261","v4.4.260","v4.4.259","v4.4.258","v4.4.257","v4.4.256","v4.4.255","v4.4.254","v4.4.253","v4.4.252","v4.4.251","v4.4.250","v4.4.249","v4.4.248","v4.4.247","v4.4.246","v4.4.245","v4.4.244","v4.4.243","v4.4.242","v4.4.241","v4.4.240","v4.4.239","v4.4.238","v4.4.237","v4.4.236","v4.4.235","v4.4.234","v4.4.233","v4.4.232","v4.4.231","v4.4.230","v4.4.229","v4.4.228","v4.4.227","v4.4.226","v4.4.225","v4.4.224"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50282.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.16.83"},{"fixed":"3.17"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.4.224"},{"fixed":"4.5"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.9.224"},{"fixed":"4.9.337"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.12.0"},{"fixed":"4.14.303"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.15.0"},{"fixed":"4.19.270"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.20.0"},{"fixed":"5.4.229"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.86"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.0.16"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.1.0"},{"fixed":"6.1.2"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50282.json"}}],"schema_version":"1.9.2"}