Home > OS >  Regmap_exit quote segmentation fault
Regmap_exit quote segmentation fault

Time:11-10

Wrong place mutex_lock (), but the driver in the using method is not the problem, don't know what is wrong, it's strange

The error message below
Unable to handle the kernel NULL pointer dereference the at virtual address 00000070
PGD=a8bec000
PGD=38954831, [00000070] * * pte=00000000, * ppte=00000000
Internal error: Oops: 17 # [1] PREEMPT SMP ARM
Modules linked in: fxos8700cq 8192 cu (O) (O)
CPU: 0 PID: 643 Comm: rmmod Tainted: G O 4.1.15 g60bdf89 - dirty # 2
The Hardware name: Freescale i.M X6 Quad/DualLite (Device Tree)
Task: a87fbdc0 ti: a8e46000 task. Ti: a8e46000
PC is at mutex_lock + 0 x10/0 x50
LR is at debugfs_remove_recursive + 0 x48/0 x1a0
PC: [& lt; 808351 b0 & gt;] Lr: [& lt; 8027 e934 & gt;] PSR: a00f0013
Sp: a8e47eb8 IP: ead08 a81e3f64 fp - 016
R10:00000000 r9:8039 f36c r8: a6126cc0
R7: a6126d10 r6: a6126cc0 r5: a6126d38 r4:00000070
R3: a6003500 r2:00000000 r1: a870e850 r0:00000070
Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10 c53c7d Table: 38 bec04a DAC: 00000015
The Process rmmod (pid: 643, stack limit=0 xa8e46210)
Stack: (0 xa8e47eb8 to 0 xa8e48000)
7 ea0: a8ab66a0 8027 e934
7 ec0: a8ab66a0 a8ab6600 00000003 a81e3e20 a8e47f08 803 b439c a870e840 a8ab6600
7 ee0:00000003 a81e3e20 a8e47f08 803 af908 a870e840 a870e8c0 a81e3e20 00000003
7 f00: a8e47f08 8039 eab4 a870e9c0 a870e840 a81e3e20 7 f090a4c a81e3e54 00000081
00000000 8039 7 f20:8000 f544 a8e46000 bbb0 a81e3e20 7 f090a4c a81e3e54 c344 8039
7 f40:7 f090a4c 016 ead44 7 eba1ab0 8039 b908 7 f090b0c 8008 b6f8 a8903540 f7866 736
7 f60:30303738 00007163 00000000 a87fc1b8 a87fc1b8 00000000 80 c118a4 a87fbdc0
7 f80:016 ead08 800449 b8 a8e46000 8000 f544 a8e47fb0 00000006 8000 f544 7 eba1c9c
7 fa0:00000002 8000 f3c0 7 eba1c9c 00000002 016 00000800 76 f00630 ead44 00002002
7 fc0:7 eba1c9c 7 eba1ab0 7 eba1dc5 00000001 00000000 016 00000081 00000002 ead08
7 fe0:76 ec5ad0 7 eba1a7c f20c ec5adc 76 0001 60070010 016 ead44 a292301 2100425 b
[& lt; 808351 b0 & gt;] (mutex_lock) from [& lt; 8027 e934 & gt;] (debugfs_remove_recursive + 0 x48/0 x1a0)
[& lt; 8027 e934 & gt;] (debugfs_remove_recursive) from [& lt; 803 b439c & gt;] (regmap_debugfs_exit + 0 x1c/0 xd0)
[& lt; 803 b439c & gt;] (regmap_debugfs_exit) from [& lt; 803 af908 & gt;] (regmap_exit + 0 x14/0 xa0)
[& lt; 803 af908 & gt;] (regmap_exit) from [& lt; 8039 eab4 & gt;] (release_nodes + 0 x168/0 x1cc)
[& lt; 8039 eab4 & gt;] (release_nodes) from [& lt; 8039 bbb0 & gt;] (__device_release_driver + 0 x78/0 xe4)
[& lt; 8039 bbb0 & gt;] (__device_release_driver) from [& lt; 8039 c344 & gt;] (driver_detach + 0 xac/0 xb0)
[& lt; 8039 c344 & gt;] (driver_detach) from [& lt; 8039 b908 & gt;] (bus_remove_driver + 0 x4c/0 xa0)
[& lt; 8039 b908 & gt;] (bus_remove_driver) from [& lt; 8008 b6f8 & gt;] (SyS_delete_module + 0 x174/0 x1b8)
[& lt; 8008 b6f8 & gt;] (SyS_delete_module) from [& lt; 8000 f3c0 & gt;] (ret_fast_syscall + 0 x0/0 x3c)
Code: e92d4010 e1a04000 f57ff05b f590f000 (e1903f9f)
- [end trace d027e681bb2bb467] -- -- --
Segmentation fault


The code is as follows:
 
Static int fxos8700cq_i2c_remove (struct i2c_client * client)
{
Struct fxos8700cq_data * pdata=https://bbs.csdn.net/topics/i2c_get_clientdata (the client);

Fxos8700cq_device_stop (the client);
Misc_deregister (& amp; Fxos8700cq_acc_device);
Regmap_exit (pdata - & gt; Regmap);
Kfree (pdata);
return 0;
}

CodePudding user response:

This is a null pointer exception, check whether the pdata is empty

CodePudding user response:

Checked before not so write
If (pdata - & gt; Regmap)
Regmap_exit (pdata - & gt; Regmap);

CodePudding user response:

If pdata is empty, the if (pdata - & gt; Regmap) there must be some problem
It should be: the if (pdata)

CodePudding user response:

This is no problem in the probe set after
 
I2c_set_clientdata (client, pdata);
  • Related