История изменений
Исправление metawishmaster, (текущая версия) :
у тебя твой init() постоянно -1 возвращает. И ещё там как минимум одна скобка пропущена.
скобка потерялась при наборее поста, но спасибо, исправил :)
а init() возвращает -1, что бы не произошло загрузка модуля, а когда я говорил, что он падает, то имел ввиду такой плевок в дмесге, если метку out поставить около строки «/* dma_pool method */» (и похожая фигня будет если goto убрать вообще):
[code]
Jul 22 12:38:15 t420s kernel: [140931.134230] => kbuf=ffff880036970000, handle= 36970000, size = 40960
Jul 22 12:38:15 t420s kernel: [140931.134233] => (kbuf-handle)= ffff880000000000, 18446612132314218496, PAGE_OFFSET=18446612132314218496, compare=0
Jul 22 12:38:15 t420s kernel: [140931.134234] => string written was, This is the dma_alloc_coherent() string
Jul 22 12:38:15 t420s kernel: [140931.134244] BUG: unable to handle kernel NULL pointer dereference at 00000000000001d8
Jul 22 12:38:15 t420s kernel: [140931.134284] IP: [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c
Jul 22 12:38:15 t420s kernel: [140931.134313] PGD 0
Jul 22 12:38:15 t420s kernel: [140931.134325] Oops: 0000 [#1] SMP
Jul 22 12:38:15 t420s kernel: [140931.134341] Modules linked in: dmalab(O+) pci_driver(O) nls_cp437 vfat fat usb_storage vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) parport_pc ppdev lp parport rfcomm bnep binfmt_misc uinput nfsd auth_rpcgss nfs_acl nfs lockd fscache sunrpc sha256_generic hmac nls_utf8 cifs loop arc4 iwldvm btusb mac80211 i915 bluetooth iwlwifi i2c_algo_bit drm_kms_helper snd_hda_codec_hdmi snd_hda_codec_conexant drm snd_hda_intel snd_hda_codec coretemp snd_hwdep thinkpad_acpi i2c_i801 snd_pcm crc32c_intel i2c_core tpm_tis tpm acpi_cpufreq ghash_clmulni_intel tpm_bios iTCO_wdt nvram mperf cfg80211 processor aesni_intel snd_page_alloc snd_seq xts aes_x86_64 lrw gf128mul ablk_helper iTCO_vendor_support lpc_ich evdev psmouse snd_seq_device snd_timer snd ehci_pci ehci_hcd wmi mfd_core pcspkr soundcore serio_raw button battery ac video cryptd rfkill ext4 crc16 mbcache jbd2 sg sr_mod sd_mod cdrom crc_t10dif ahci libahci xhci_hcd libata e1000e usbcore scsi_mod ptp pps_core usb_common sdhci_pci sd
Jul 22 12:38:15 t420s kernel: hci mmc_core thermal thermal_sys [last unloaded: pci_driver]
Jul 22 12:38:15 t420s kernel: [140931.134847] CPU 1
Jul 22 12:38:15 t420s kernel: [140931.134858] Pid: 15229, comm: insmod Tainted: G O 3.9.8 #4 LENOVO 41732BG/41732BG
Jul 22 12:38:15 t420s kernel: [140931.134893] RIP: 0010:[<ffffffff811d62d0>] [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c
Jul 22 12:38:15 t420s kernel: [140931.134930] RSP: 0018:ffff880319331d18 EFLAGS: 00010293
Jul 22 12:38:15 t420s kernel: [140931.134952] RAX: 00000003164c0000 RBX: ffff8803164c0000 RCX: 6db6db6db6db6db7
Jul 22 12:38:15 t420s kernel: [140931.134981] RDX: 0000000000000000 RSI: 00000003164c0000 RDI: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135009] RBP: 000000000000a000 R08: 0000000000000000 R09: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135038] R10: dead000000200200 R11: ffff880036970000 R12: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135067] R13: 000000000000165a R14: 0000000000000001 R15: ffff880319331ef8
Jul 22 12:38:15 t420s kernel: [140931.135096] FS: 00007f6377483700(0000) GS:ffff88041e240000(0000) knlGS:0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135128] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jul 22 12:38:15 t420s kernel: [140931.135152] CR2: 00000000000001d8 CR3: 00000001ad4c3000 CR4: 00000000000407e0
Jul 22 12:38:15 t420s kernel: [140931.135181] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135210] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Jul 22 12:38:15 t420s kernel: [140931.135239] Process insmod (pid: 15229, threadinfo ffff880319330000, task ffff8803258430c0)
Jul 22 12:38:15 t420s kernel: [140931.135272] Stack:
Jul 22 12:38:15 t420s kernel: [140931.135282] ffff8803164c0000 0000000036970000 ffffffff816206d0 ffffffffa01f6138
Jul 22 12:38:15 t420s kernel: [140931.135317] 000000000000165a 0000000036970000 ffffffffa0731000 ffffffffa01f6000
Jul 22 12:38:15 t420s kernel: [140931.135351] 0000000000000000 ffffffff8100209f ffffffffa01f6000 ffffffffa0731000
Jul 22 12:38:15 t420s kernel: [140931.135386] Call Trace:
Jul 22 12:38:15 t420s kernel: [140931.135400] [<ffffffffa01f6138>] ? my_init+0x138/0x1000 [dmalab]
Jul 22 12:38:15 t420s kernel: [140931.135428] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff
Jul 22 12:38:15 t420s kernel: [140931.135451] [<ffffffff8100209f>] ? do_one_initcall+0x75/0x12a
Jul 22 12:38:15 t420s kernel: [140931.135477] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff
Jul 22 12:38:15 t420s kernel: [140931.135500] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff
Jul 22 12:38:15 t420s kernel: [140931.135523] [<ffffffff81085637>] ? load_module+0x1b03/0x1e08
Jul 22 12:38:15 t420s kernel: [140931.135548] [<ffffffff8108208d>] ? free_notes_attrs+0x40/0x40
Jul 22 12:38:15 t420s kernel: [140931.135574] [<ffffffff810ebd2b>] ? vmap_page_range_noflush+0x1e3/0x27c
Jul 22 12:38:15 t420s kernel: [140931.135610] [<ffffffff810859da>] ? sys_init_module+0x9e/0xab
Jul 22 12:38:15 t420s kernel: [140931.135637] [<ffffffff8137e6ad>] ? system_call_fastpath+0x1a/0x1f
Jul 22 12:38:15 t420s kernel: [140931.135662] Code: c4 48 01 f0 55 48 c1 f8 03 48 89 cd 48 b9 b7 6d db b6 6d db b6 6d 48 0f af c1 53 48 c1 e0 0c 41 83 f8 03 48 8d 34 10 75 02 0f 0b <48> 8b 87 d8 01 00 00 48 89 fb 48 85 c0 74 17 48 8d 54 2e ff 48
Jul 22 12:38:15 t420s kernel: [140931.135813] RIP [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c
Jul 22 12:38:15 t420s kernel: [140931.135839] RSP <ffff880319331d18>
Jul 22 12:38:15 t420s kernel: [140931.135853] CR2: 00000000000001d8
Jul 22 12:38:15 t420s kernel: [140931.142681] ---[ end trace 357b3e03d44b06d3 ]---
[/code]
Исправление metawishmaster, :
[code]
у тебя твой init() постоянно -1 возвращает. И ещё там как минимум одна скобка пропущена.
скобка потерялась при наборее поста, но спасибо, исправил :)
а init() возвращает -1, что бы не произошло загрузка модуля, а когда я говорил, что он падает, то имел ввиду такой плевок в дмесге, если метку out поставить около строки «/* dma_pool method */» (и похожая фигня будет если goto убрать вообще):
Jul 22 12:38:15 t420s kernel: [140931.134230] => kbuf=ffff880036970000, handle= 36970000, size = 40960
Jul 22 12:38:15 t420s kernel: [140931.134233] => (kbuf-handle)= ffff880000000000, 18446612132314218496, PAGE_OFFSET=18446612132314218496, compare=0
Jul 22 12:38:15 t420s kernel: [140931.134234] => string written was, This is the dma_alloc_coherent() string
Jul 22 12:38:15 t420s kernel: [140931.134244] BUG: unable to handle kernel NULL pointer dereference at 00000000000001d8
Jul 22 12:38:15 t420s kernel: [140931.134284] IP: [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c
Jul 22 12:38:15 t420s kernel: [140931.134313] PGD 0
Jul 22 12:38:15 t420s kernel: [140931.134325] Oops: 0000 [#1] SMP
Jul 22 12:38:15 t420s kernel: [140931.134341] Modules linked in: dmalab(O+) pci_driver(O) nls_cp437 vfat fat usb_storage vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) parport_pc ppdev lp parport rfcomm bnep binfmt_misc uinput nfsd auth_rpcgss nfs_acl nfs lockd fscache sunrpc sha256_generic hmac nls_utf8 cifs loop arc4 iwldvm btusb mac80211 i915 bluetooth iwlwifi i2c_algo_bit drm_kms_helper snd_hda_codec_hdmi snd_hda_codec_conexant drm snd_hda_intel snd_hda_codec coretemp snd_hwdep thinkpad_acpi i2c_i801 snd_pcm crc32c_intel i2c_core tpm_tis tpm acpi_cpufreq ghash_clmulni_intel tpm_bios iTCO_wdt nvram mperf cfg80211 processor aesni_intel snd_page_alloc snd_seq xts aes_x86_64 lrw gf128mul ablk_helper iTCO_vendor_support lpc_ich evdev psmouse snd_seq_device snd_timer snd ehci_pci ehci_hcd wmi mfd_core pcspkr soundcore serio_raw button battery ac video cryptd rfkill ext4 crc16 mbcache jbd2 sg sr_mod sd_mod cdrom crc_t10dif ahci libahci xhci_hcd libata e1000e usbcore scsi_mod ptp pps_core usb_common sdhci_pci sd
Jul 22 12:38:15 t420s kernel: hci mmc_core thermal thermal_sys [last unloaded: pci_driver]
Jul 22 12:38:15 t420s kernel: [140931.134847] CPU 1
Jul 22 12:38:15 t420s kernel: [140931.134858] Pid: 15229, comm: insmod Tainted: G O 3.9.8 #4 LENOVO 41732BG/41732BG
Jul 22 12:38:15 t420s kernel: [140931.134893] RIP: 0010:[<ffffffff811d62d0>] [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c
Jul 22 12:38:15 t420s kernel: [140931.134930] RSP: 0018:ffff880319331d18 EFLAGS: 00010293
Jul 22 12:38:15 t420s kernel: [140931.134952] RAX: 00000003164c0000 RBX: ffff8803164c0000 RCX: 6db6db6db6db6db7
Jul 22 12:38:15 t420s kernel: [140931.134981] RDX: 0000000000000000 RSI: 00000003164c0000 RDI: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135009] RBP: 000000000000a000 R08: 0000000000000000 R09: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135038] R10: dead000000200200 R11: ffff880036970000 R12: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135067] R13: 000000000000165a R14: 0000000000000001 R15: ffff880319331ef8
Jul 22 12:38:15 t420s kernel: [140931.135096] FS: 00007f6377483700(0000) GS:ffff88041e240000(0000) knlGS:0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135128] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jul 22 12:38:15 t420s kernel: [140931.135152] CR2: 00000000000001d8 CR3: 00000001ad4c3000 CR4: 00000000000407e0
Jul 22 12:38:15 t420s kernel: [140931.135181] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135210] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Jul 22 12:38:15 t420s kernel: [140931.135239] Process insmod (pid: 15229, threadinfo ffff880319330000, task ffff8803258430c0)
Jul 22 12:38:15 t420s kernel: [140931.135272] Stack:
Jul 22 12:38:15 t420s kernel: [140931.135282] ffff8803164c0000 0000000036970000 ffffffff816206d0 ffffffffa01f6138
Jul 22 12:38:15 t420s kernel: [140931.135317] 000000000000165a 0000000036970000 ffffffffa0731000 ffffffffa01f6000
Jul 22 12:38:15 t420s kernel: [140931.135351] 0000000000000000 ffffffff8100209f ffffffffa01f6000 ffffffffa0731000
Jul 22 12:38:15 t420s kernel: [140931.135386] Call Trace:
Jul 22 12:38:15 t420s kernel: [140931.135400] [<ffffffffa01f6138>] ? my_init+0x138/0x1000 [dmalab]
Jul 22 12:38:15 t420s kernel: [140931.135428] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff
Jul 22 12:38:15 t420s kernel: [140931.135451] [<ffffffff8100209f>] ? do_one_initcall+0x75/0x12a
Jul 22 12:38:15 t420s kernel: [140931.135477] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff
Jul 22 12:38:15 t420s kernel: [140931.135500] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff
Jul 22 12:38:15 t420s kernel: [140931.135523] [<ffffffff81085637>] ? load_module+0x1b03/0x1e08
Jul 22 12:38:15 t420s kernel: [140931.135548] [<ffffffff8108208d>] ? free_notes_attrs+0x40/0x40
Jul 22 12:38:15 t420s kernel: [140931.135574] [<ffffffff810ebd2b>] ? vmap_page_range_noflush+0x1e3/0x27c
Jul 22 12:38:15 t420s kernel: [140931.135610] [<ffffffff810859da>] ? sys_init_module+0x9e/0xab
Jul 22 12:38:15 t420s kernel: [140931.135637] [<ffffffff8137e6ad>] ? system_call_fastpath+0x1a/0x1f
Jul 22 12:38:15 t420s kernel: [140931.135662] Code: c4 48 01 f0 55 48 c1 f8 03 48 89 cd 48 b9 b7 6d db b6 6d db b6 6d 48 0f af c1 53 48 c1 e0 0c 41 83 f8 03 48 8d 34 10 75 02 0f 0b <48> 8b 87 d8 01 00 00 48 89 fb 48 85 c0 74 17 48 8d 54 2e ff 48
Jul 22 12:38:15 t420s kernel: [140931.135813] RIP [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c
Jul 22 12:38:15 t420s kernel: [140931.135839] RSP <ffff880319331d18>
Jul 22 12:38:15 t420s kernel: [140931.135853] CR2: 00000000000001d8
Jul 22 12:38:15 t420s kernel: [140931.142681] ---[ end trace 357b3e03d44b06d3 ]---
[/code]
Исправление metawishmaster, :
[br]у тебя твой init() постоянно -1 возвращает. И ещё там как минимум одна скобка пропущена.[br][/quote][br]скобка потерялась при наборее поста, но спасибо, исправил :)[br]а init() возвращает -1, что бы не произошло загрузка модуля, а когда я говорил, что он падает, то имел ввиду такой плевок в дмесге, если метку out поставить около строки "/* dma_pool method */" (и похожая фигня будет если goto убрать вообще):[br][quote][br]Jul 22 12:38:15 t420s kernel: [140931.134230] => kbuf=ffff880036970000, handle= 36970000, size = 40960 [br]Jul 22 12:38:15 t420s kernel: [140931.134233] => (kbuf-handle)= ffff880000000000, 18446612132314218496, PAGE_OFFSET=18446612132314218496, compare=0[br]Jul 22 12:38:15 t420s kernel: [140931.134234] => string written was, This is the dma_alloc_coherent() string[br]Jul 22 12:38:15 t420s kernel: [140931.134244] BUG: unable to handle kernel NULL pointer dereference at 00000000000001d8[br]Jul 22 12:38:15 t420s kernel: [140931.134284] IP: [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c[br]Jul 22 12:38:15 t420s kernel: [140931.134313] PGD 0 [br]Jul 22 12:38:15 t420s kernel: [140931.134325] Oops: 0000 [#1] SMP[br]Jul 22 12:38:15 t420s kernel: [140931.134341] Modules linked in: dmalab(O+) pci_driver(O) nls_cp437 vfat fat usb_storage vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) parport_pc ppdev lp parport rfcomm bnep binfmt_misc uinput nfsd auth_rpcgss nfs_acl nfs lockd fscache sunrpc sha256_generic hmac nls_utf8 cifs loop arc4 iwldvm btusb mac80211 i915 bluetooth iwlwifi i2c_algo_bit drm_kms_helper snd_hda_codec_hdmi snd_hda_codec_conexant drm snd_hda_intel snd_hda_codec coretemp snd_hwdep thinkpad_acpi i2c_i801 snd_pcm crc32c_intel i2c_core tpm_tis tpm acpi_cpufreq ghash_clmulni_intel tpm_bios iTCO_wdt nvram mperf cfg80211 processor aesni_intel snd_page_alloc snd_seq xts aes_x86_64 lrw gf128mul ablk_helper iTCO_vendor_support lpc_ich evdev psmouse snd_seq_device snd_timer snd ehci_pci ehci_hcd wmi mfd_core pcspkr soundcore serio_raw button battery ac video cryptd rfkill ext4 crc16 mbcache jbd2 sg sr_mod sd_mod cdrom crc_t10dif ahci libahci xhci_hcd libata e1000e usbcore scsi_mod ptp pps_core usb_common sdhci_pci sd[br]Jul 22 12:38:15 t420s kernel: hci mmc_core thermal thermal_sys [last unloaded: pci_driver][br]Jul 22 12:38:15 t420s kernel: [140931.134847] CPU 1[br]Jul 22 12:38:15 t420s kernel: [140931.134858] Pid: 15229, comm: insmod Tainted: G O 3.9.8 #4 LENOVO 41732BG/41732BG[br]Jul 22 12:38:15 t420s kernel: [140931.134893] RIP: 0010:[<ffffffff811d62d0>] [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c[br]Jul 22 12:38:15 t420s kernel: [140931.134930] RSP: 0018:ffff880319331d18 EFLAGS: 00010293 [br]Jul 22 12:38:15 t420s kernel: [140931.134952] RAX: 00000003164c0000 RBX: ffff8803164c0000 RCX: 6db6db6db6db6db7[br]Jul 22 12:38:15 t420s kernel: [140931.134981] RDX: 0000000000000000 RSI: 00000003164c0000 RDI: 0000000000000000[br]Jul 22 12:38:15 t420s kernel: [140931.135009] RBP: 000000000000a000 R08: 0000000000000000 R09: 0000000000000000[br]Jul 22 12:38:15 t420s kernel: [140931.135038] R10: dead000000200200 R11: ffff880036970000 R12: 0000000000000000[br]Jul 22 12:38:15 t420s kernel: [140931.135067] R13: 000000000000165a R14: 0000000000000001 R15: ffff880319331ef8[br]Jul 22 12:38:15 t420s kernel: [140931.135096] FS: 00007f6377483700(0000) GS:ffff88041e240000(0000) knlGS:0000000000000000[br]Jul 22 12:38:15 t420s kernel: [140931.135128] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [br]Jul 22 12:38:15 t420s kernel: [140931.135152] CR2: 00000000000001d8 CR3: 00000001ad4c3000 CR4: 00000000000407e0[br]Jul 22 12:38:15 t420s kernel: [140931.135181] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000[br]Jul 22 12:38:15 t420s kernel: [140931.135210] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400[br]Jul 22 12:38:15 t420s kernel: [140931.135239] Process insmod (pid: 15229, threadinfo ffff880319330000, task ffff8803258430c0)[br]Jul 22 12:38:15 t420s kernel: [140931.135272] Stack:[br]Jul 22 12:38:15 t420s kernel: [140931.135282] ffff8803164c0000 0000000036970000 ffffffff816206d0 ffffffffa01f6138[br]Jul 22 12:38:15 t420s kernel: [140931.135317] 000000000000165a 0000000036970000 ffffffffa0731000 ffffffffa01f6000[br]Jul 22 12:38:15 t420s kernel: [140931.135351] 0000000000000000 ffffffff8100209f ffffffffa01f6000 ffffffffa0731000[br]Jul 22 12:38:15 t420s kernel: [140931.135386] Call Trace:[br]Jul 22 12:38:15 t420s kernel: [140931.135400] [<ffffffffa01f6138>] ? my_init+0x138/0x1000 [dmalab][br]Jul 22 12:38:15 t420s kernel: [140931.135428] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff[br]Jul 22 12:38:15 t420s kernel: [140931.135451] [<ffffffff8100209f>] ? do_one_initcall+0x75/0x12a[br]Jul 22 12:38:15 t420s kernel: [140931.135477] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff[br]Jul 22 12:38:15 t420s kernel: [140931.135500] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff[br]Jul 22 12:38:15 t420s kernel: [140931.135523] [<ffffffff81085637>] ? load_module+0x1b03/0x1e08[br]Jul 22 12:38:15 t420s kernel: [140931.135548] [<ffffffff8108208d>] ? free_notes_attrs+0x40/0x40[br]Jul 22 12:38:15 t420s kernel: [140931.135574] [<ffffffff810ebd2b>] ? vmap_page_range_noflush+0x1e3/0x27c[br]Jul 22 12:38:15 t420s kernel: [140931.135610] [<ffffffff810859da>] ? sys_init_module+0x9e/0xab[br]Jul 22 12:38:15 t420s kernel: [140931.135637] [<ffffffff8137e6ad>] ? system_call_fastpath+0x1a/0x1f[br]Jul 22 12:38:15 t420s kernel: [140931.135662] Code: c4 48 01 f0 55 48 c1 f8 03 48 89 cd 48 b9 b7 6d db b6 6d db b6 6d 48 0f af c1 53 48 c1 e0 0c 41 83 f8 03 48 8d 34 10 75 02 0f 0b <48> 8b 87 d8 01 00 00 48 89 fb 48 85 c0 74 17 48 8d 54 2e ff 48[br]Jul 22 12:38:15 t420s kernel: [140931.135813] RIP [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c[br]Jul 22 12:38:15 t420s kernel: [140931.135839] RSP <ffff880319331d18>[br]Jul 22 12:38:15 t420s kernel: [140931.135853] CR2: 00000000000001d8[br]Jul 22 12:38:15 t420s kernel: [140931.142681] ---[ end trace 357b3e03d44b06d3 ]---[br]
Исходная версия metawishmaster, :
у тебя твой init() постоянно -1 возвращает. И ещё там как минимум одна скобка пропущена.
скобка потерялась при наборее поста, но спасибо, исправил :)
а init() возвращает -1, что бы не произошло загрузка модуля, а когда я говорил, что он падает, то имел ввиду такой плевок в дмесге, если метку out поставить около строки «/* dma_pool method */» (и похожая фигня будет если goto убрать вообще):
Jul 22 12:38:15 t420s kernel: [140931.134230] => kbuf=ffff880036970000, handle= 36970000, size = 40960
Jul 22 12:38:15 t420s kernel: [140931.134233] => (kbuf-handle)= ffff880000000000, 18446612132314218496, PAGE_OFFSET=18446612132314218496, compare=0
Jul 22 12:38:15 t420s kernel: [140931.134234] => string written was, This is the dma_alloc_coherent() string
Jul 22 12:38:15 t420s kernel: [140931.134244] BUG: unable to handle kernel NULL pointer dereference at 00000000000001d8
Jul 22 12:38:15 t420s kernel: [140931.134284] IP: [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c
Jul 22 12:38:15 t420s kernel: [140931.134313] PGD 0
Jul 22 12:38:15 t420s kernel: [140931.134325] Oops: 0000 [#1] SMP
Jul 22 12:38:15 t420s kernel: [140931.134341] Modules linked in: dmalab(O+) pci_driver(O) nls_cp437 vfat fat usb_storage vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) parport_pc ppdev lp parport rfcomm bnep binfmt_misc uinput nfsd auth_rpcgss nfs_acl nfs lockd fscache sunrpc sha256_generic hmac nls_utf8 cifs loop arc4 iwldvm btusb mac80211 i915 bluetooth iwlwifi i2c_algo_bit drm_kms_helper snd_hda_codec_hdmi snd_hda_codec_conexant drm snd_hda_intel snd_hda_codec coretemp snd_hwdep thinkpad_acpi i2c_i801 snd_pcm crc32c_intel i2c_core tpm_tis tpm acpi_cpufreq ghash_clmulni_intel tpm_bios iTCO_wdt nvram mperf cfg80211 processor aesni_intel snd_page_alloc snd_seq xts aes_x86_64 lrw gf128mul ablk_helper iTCO_vendor_support lpc_ich evdev psmouse snd_seq_device snd_timer snd ehci_pci ehci_hcd wmi mfd_core pcspkr soundcore serio_raw button battery ac video cryptd rfkill ext4 crc16 mbcache jbd2 sg sr_mod sd_mod cdrom crc_t10dif ahci libahci xhci_hcd libata e1000e usbcore scsi_mod ptp pps_core usb_common sdhci_pci sd
Jul 22 12:38:15 t420s kernel: hci mmc_core thermal thermal_sys [last unloaded: pci_driver]
Jul 22 12:38:15 t420s kernel: [140931.134847] CPU 1
Jul 22 12:38:15 t420s kernel: [140931.134858] Pid: 15229, comm: insmod Tainted: G O 3.9.8 #4 LENOVO 41732BG/41732BG
Jul 22 12:38:15 t420s kernel: [140931.134893] RIP: 0010:[<ffffffff811d62d0>] [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c
Jul 22 12:38:15 t420s kernel: [140931.134930] RSP: 0018:ffff880319331d18 EFLAGS: 00010293
Jul 22 12:38:15 t420s kernel: [140931.134952] RAX: 00000003164c0000 RBX: ffff8803164c0000 RCX: 6db6db6db6db6db7
Jul 22 12:38:15 t420s kernel: [140931.134981] RDX: 0000000000000000 RSI: 00000003164c0000 RDI: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135009] RBP: 000000000000a000 R08: 0000000000000000 R09: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135038] R10: dead000000200200 R11: ffff880036970000 R12: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135067] R13: 000000000000165a R14: 0000000000000001 R15: ffff880319331ef8
Jul 22 12:38:15 t420s kernel: [140931.135096] FS: 00007f6377483700(0000) GS:ffff88041e240000(0000) knlGS:0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135128] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jul 22 12:38:15 t420s kernel: [140931.135152] CR2: 00000000000001d8 CR3: 00000001ad4c3000 CR4: 00000000000407e0
Jul 22 12:38:15 t420s kernel: [140931.135181] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Jul 22 12:38:15 t420s kernel: [140931.135210] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Jul 22 12:38:15 t420s kernel: [140931.135239] Process insmod (pid: 15229, threadinfo ffff880319330000, task ffff8803258430c0)
Jul 22 12:38:15 t420s kernel: [140931.135272] Stack:
Jul 22 12:38:15 t420s kernel: [140931.135282] ffff8803164c0000 0000000036970000 ffffffff816206d0 ffffffffa01f6138
Jul 22 12:38:15 t420s kernel: [140931.135317] 000000000000165a 0000000036970000 ffffffffa0731000 ffffffffa01f6000
Jul 22 12:38:15 t420s kernel: [140931.135351] 0000000000000000 ffffffff8100209f ffffffffa01f6000 ffffffffa0731000
Jul 22 12:38:15 t420s kernel: [140931.135386] Call Trace:
Jul 22 12:38:15 t420s kernel: [140931.135400] [<ffffffffa01f6138>] ? my_init+0x138/0x1000 [dmalab]
Jul 22 12:38:15 t420s kernel: [140931.135428] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff
Jul 22 12:38:15 t420s kernel: [140931.135451] [<ffffffff8100209f>] ? do_one_initcall+0x75/0x12a
Jul 22 12:38:15 t420s kernel: [140931.135477] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff
Jul 22 12:38:15 t420s kernel: [140931.135500] [<ffffffffa01f6000>] ? 0xffffffffa01f5fff
Jul 22 12:38:15 t420s kernel: [140931.135523] [<ffffffff81085637>] ? load_module+0x1b03/0x1e08
Jul 22 12:38:15 t420s kernel: [140931.135548] [<ffffffff8108208d>] ? free_notes_attrs+0x40/0x40
Jul 22 12:38:15 t420s kernel: [140931.135574] [<ffffffff810ebd2b>] ? vmap_page_range_noflush+0x1e3/0x27c
Jul 22 12:38:15 t420s kernel: [140931.135610] [<ffffffff810859da>] ? sys_init_module+0x9e/0xab
Jul 22 12:38:15 t420s kernel: [140931.135637] [<ffffffff8137e6ad>] ? system_call_fastpath+0x1a/0x1f
Jul 22 12:38:15 t420s kernel: [140931.135662] Code: c4 48 01 f0 55 48 c1 f8 03 48 89 cd 48 b9 b7 6d db b6 6d db b6 6d 48 0f af c1 53 48 c1 e0 0c 41 83 f8 03 48 8d 34 10 75 02 0f 0b <48> 8b 87 d8 01 00 00 48 89 fb 48 85 c0 74 17 48 8d 54 2e ff 48
Jul 22 12:38:15 t420s kernel: [140931.135813] RIP [<ffffffff811d62d0>] swiotlb_map_page+0x39/0x10c
Jul 22 12:38:15 t420s kernel: [140931.135839] RSP <ffff880319331d18>
Jul 22 12:38:15 t420s kernel: [140931.135853] CR2: 00000000000001d8
Jul 22 12:38:15 t420s kernel: [140931.142681] ---[ end trace 357b3e03d44b06d3 ]---