[9610][ERD] drivers: muic: fix prevent CID 237155
authorKim Taejeong <tj.kim@samsung.com>
Tue, 28 Aug 2018 00:56:03 +0000 (09:56 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:01 +0000 (20:23 +0300)
commit1297f2e8a361c5ee97d3019016bd8aefed48b782
tree093ef3fa59c2115a6c8bc24554deb02ec2c40573
parenta6e88bc30700ac9b877d4fcdd686e6bfe61c1bae
[9610][ERD] drivers: muic: fix prevent CID 237155

- Fix problem of dereference before null check.
- System comment:

1579 static irqreturn_t s2mu004_muic_detach_isr(int irq, void *data)
1580 {
1581         struct s2mu004_muic_data *muic_data = data;
/* deref_ptr: Directly dereferencing pointer muic_data. */
1582        struct muic_platform_data *muic_pdata = muic_data->pdata;
1583        struct muic_interface_t *muic_if = muic_data->if_data;
1584
/* CID 237155 (#1 of 1): Dereference before null check (REVERSE_INULL)
 * check_after_deref: Null-checking muic_data suggests that it may be null,
 * but it has already been dereferenced on all paths leading to the check.
 */
1585        if (muic_data == NULL || muic_pdata == NULL || muic_if == NULL) {
1586                pr_err("%s, data NULL\n", __func__);
1587                return IRQ_NONE;
1588        }

Change-Id: I6cb3128153c8a062fdd141a39abd87607ec29f15
Signed-off-by: Kim Taejeong <tj.kim@samsung.com>
drivers/muic/s2mu004-muic.c