Re: KASAN: use-after-free Read in hfa384x_usbin_callback

2020-03-25 Thread Qiujun Huang
#syz test: https://github.com/google/kasan.git e17994d1

On Mon, Mar 23, 2020 at 8:39 PM syzbot
 wrote:
>
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit:e17994d1 usb: core: kcov: collect coverage from usb comple..
> git tree:   https://github.com/google/kasan.git usb-fuzzer
> console output: https://syzkaller.appspot.com/x/log.txt?x=15217373e0
> kernel config:  https://syzkaller.appspot.com/x/.config?x=5d64370c438bc60
> dashboard link: https://syzkaller.appspot.com/bug?extid=a57b24d359dc5577634a
> compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=14a720ade0
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1467b755e0
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+a57b24d359dc55776...@syzkaller.appspotmail.com
>
> ==
> BUG: KASAN: use-after-free in memcpy include/linux/string.h:381 [inline]
> BUG: KASAN: use-after-free in skb_put_data include/linux/skbuff.h:2284 
> [inline]
> BUG: KASAN: use-after-free in hfa384x_int_rxmonitor 
> drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
> BUG: KASAN: use-after-free in hfa384x_usbin_rx 
> drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
> BUG: KASAN: use-after-free in hfa384x_usbin_callback+0x1993/0x2360 
> drivers/staging/wlan-ng/hfa384x_usb.c:3026
> Read of size 34945 at addr 8881cda9f33c by task swapper/0/0
>
> CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc5-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS 
> Google 01/01/2011
> Call Trace:
>  
>  __dump_stack lib/dump_stack.c:77 [inline]
>  dump_stack+0xef/0x16e lib/dump_stack.c:118
>  print_address_description.constprop.0.cold+0xd3/0x314 mm/kasan/report.c:374
>  __kasan_report.cold+0x37/0x77 mm/kasan/report.c:506
>  kasan_report+0xe/0x20 mm/kasan/common.c:641
>  check_memory_region_inline mm/kasan/generic.c:185 [inline]
>  check_memory_region+0x152/0x1c0 mm/kasan/generic.c:192
>  memcpy+0x20/0x50 mm/kasan/common.c:127
>  memcpy include/linux/string.h:381 [inline]
>  skb_put_data include/linux/skbuff.h:2284 [inline]
>  hfa384x_int_rxmonitor drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
>  hfa384x_usbin_rx drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
>  hfa384x_usbin_callback+0x1993/0x2360 
> drivers/staging/wlan-ng/hfa384x_usb.c:3026
>  __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
>  usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
>  dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966
>  call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404
>  expire_timers kernel/time/timer.c:1449 [inline]
>  __run_timers kernel/time/timer.c:1773 [inline]
>  __run_timers kernel/time/timer.c:1740 [inline]
>  run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786
>  __do_softirq+0x21e/0x950 kernel/softirq.c:292
>  invoke_softirq kernel/softirq.c:373 [inline]
>  irq_exit+0x178/0x1a0 kernel/softirq.c:413
>  exiting_irq arch/x86/include/asm/apic.h:546 [inline]
>  smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146
>  apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
>  
> RIP: 0010:default_idle+0x28/0x300 arch/x86/kernel/process.c:696
> Code: cc cc 41 56 41 55 65 44 8b 2d 44 77 72 7a 41 54 55 53 0f 1f 44 00 00 e8 
> b6 62 b5 fb e9 07 00 00 00 0f 00 2d ea 0c 53 00 fb f4 <65> 44 8b 2d 20 77 72 
> 7a 0f 1f 44 00 00 5b 5d 41 5c 41 5d 41 5e c3
> RSP: 0018:87007d80 EFLAGS: 0246 ORIG_RAX: ff13
> RAX: 0007 RBX: 8702cc40 RCX: 
> RDX:  RSI: 0006 RDI: 8702d48c
> RBP: fbfff0e05988 R08: 8702cc40 R09: 
> R10:  R11:  R12: 
> R13:  R14: 87e607c0 R15: 
>  cpuidle_idle_call kernel/sched/idle.c:154 [inline]
>  do_idle+0x3e0/0x500 kernel/sched/idle.c:269
>  cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:361
>  start_kernel+0xe16/0xe5a init/main.c:998
>  secondary_startup_64+0xb6/0xc0 arch/x86/kernel/head_64.S:242
>
> The buggy address belongs to the page:
> page:ea000736a600 refcount:32769 mapcount:0 mapping: 
> index:0x0 compound_mapcount: 0
> flags: 0x201(head)
> raw: 0201 dead0100 dead0122 
> raw:   8001 
> page dumped because: kasan: bad access detected
>
> Memory state around the buggy address:
>  8881cda9ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>  8881cda9ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >8881cdaa: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>^
>  8881cdaa0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>  8881cdaa0100: fb fb fb fb fb fb fb fb fb fb fb 

[staging:staging-testing] BUILD SUCCESS f1a49bb9c8197170a1e3f645c4e73ec7fe7ddefb

2020-03-25 Thread kbuild test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
 staging-testing
branch HEAD: f1a49bb9c8197170a1e3f645c4e73ec7fe7ddefb  staging: rtl8723bs: 
Remove blank line before '}' brace

elapsed time: 482m

configs tested: 174
configs skipped: 0

The following configs have been built successfully.
More configs may be tested in the coming days.

arm  allmodconfig
arm   allnoconfig
arm  allyesconfig
arm64allmodconfig
arm64 allnoconfig
arm64allyesconfig
arm   efm32_defconfig
arm at91_dt_defconfig
armshmobile_defconfig
arm64   defconfig
arm  exynos_defconfig
armmulti_v5_defconfig
arm   sunxi_defconfig
armmulti_v7_defconfig
sparcallyesconfig
openriscor1ksim_defconfig
powerpc   ppc64_defconfig
ia64 allyesconfig
s390 allyesconfig
i386  allnoconfig
i386 alldefconfig
i386 allyesconfig
i386defconfig
ia64 alldefconfig
ia64 allmodconfig
ia64  allnoconfig
ia64defconfig
c6x  allyesconfig
c6xevmc6678_defconfig
nios2 10m50_defconfig
nios2 3c120_defconfig
openrisc simple_smp_defconfig
xtensa   common_defconfig
xtensa  iss_defconfig
nds32   defconfig
nds32 allnoconfig
cskydefconfig
alpha   defconfig
h8300   h8s-sim_defconfig
h8300 edosk2674_defconfig
m68k   m5475evb_defconfig
m68k allmodconfig
h8300h8300h-sim_defconfig
m68k   sun3_defconfig
m68k  multi_defconfig
arc defconfig
arc  allyesconfig
powerpc defconfig
powerpc  rhel-kconfig
microblaze  mmu_defconfig
microblazenommu_defconfig
powerpc   allnoconfig
mips   32r2_defconfig
mips 64r6el_defconfig
mips allmodconfig
mips  allnoconfig
mips allyesconfig
mips  fuloong2e_defconfig
mips  malta_kvm_defconfig
pariscallnoconfig
parisc   allyesconfig
pariscgeneric-32bit_defconfig
pariscgeneric-64bit_defconfig
x86_64   randconfig-a001-20200326
x86_64   randconfig-a002-20200326
x86_64   randconfig-a003-20200326
i386 randconfig-a001-20200326
i386 randconfig-a002-20200326
i386 randconfig-a003-20200326
alpharandconfig-a001-20200325
m68k randconfig-a001-20200325
nds32randconfig-a001-20200325
parisc   randconfig-a001-20200325
riscvrandconfig-a001-20200325
mips randconfig-a001-20200325
h8300randconfig-a001-20200325
microblaze   randconfig-a001-20200325
nios2randconfig-a001-20200325
c6x  randconfig-a001-20200325
sparc64  randconfig-a001-20200325
s390 randconfig-a001-20200325
xtensa   randconfig-a001-20200325
csky randconfig-a001-20200325
openrisc randconfig-a001-20200325
sh   randconfig-a001-20200325
csky randconfig-a001-20200326
openrisc randconfig-a001-20200326
s390 randconfig-a001-20200326
xtensa   randconfig-a001-20200326
x86_64   randconfig-b001-20200325
x86_64   randconfig-b002-20200325
x86_64   randconfig-b003-20200325
i386 randconfig-b001-20200325
i386 randconfig-b002-20200325
i386 randconfig-b003-20200325
x86_64   randconfig-c001-20200325
x86_64   randconfig-c002-20200325
x86_64   randconfig-c003-20200325
i386 randconfig-c001-20200325
i386 randconfig-c002-20200325
i386

Re: KASAN: slab-out-of-bounds Read in hfa384x_usbin_callback

2020-03-25 Thread syzbot
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger crash:

Reported-and-tested-by: syzbot+7d42d68643a35f71a...@syzkaller.appspotmail.com

Tested on:

commit: e17994d1 usb: core: kcov: collect coverage from usb comple..
git tree:   https://github.com/google/kasan.git
kernel config:  https://syzkaller.appspot.com/x/.config?x=5d64370c438bc60
dashboard link: https://syzkaller.appspot.com/bug?extid=7d42d68643a35f71ac8a
compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
patch:  https://syzkaller.appspot.com/x/patch.diff?x=1406d1d3e0

Note: testing is done by a robot and is best-effort only.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: KASAN: slab-out-of-bounds Read in hfa384x_usbin_callback

2020-03-25 Thread Qiujun Huang
#syz test: https://github.com/google/kasan.git e17994d1


forgot to trigger:(

On Thu, Mar 26, 2020 at 10:22 AM Qiujun Huang  wrote:
>
> On Wed, Mar 25, 2020 at 9:13 PM Hillf Danton  wrote:
> >
> >
> > On Wed, 25 Mar 2020 01:58:03 -0700
> > > syzbot has tested the proposed patch but the reproducer still triggered 
> > > crash:
> > > KASAN: use-after-free Read in hfa384x_usbin_callback
> > >
> > > ==
> > > BUG: KASAN: use-after-free in memcpy include/linux/string.h:381 [inline]
> > > BUG: KASAN: use-after-free in skb_put_data include/linux/skbuff.h:2284 
> > > [inline]
> > > BUG: KASAN: use-after-free in hfa384x_int_rxmonitor 
> > > drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
> > > BUG: KASAN: use-after-free in hfa384x_usbin_rx 
> > > drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
> > > BUG: KASAN: use-after-free in hfa384x_usbin_callback+0x1993/0x2360 
> > > drivers/staging/wlan-ng/hfa384x_usb.c:3026
> > > Read of size 19671 at addr 8881cda7b33c by task kworker/1:2/95
> > >
> > > CPU: 1 PID: 95 Comm: kworker/1:2 Not tainted 5.6.0-rc5-syzkaller #0
> > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS 
> > > Google 01/01/2011
> > > Workqueue: usb_hub_wq hub_event
> > > Call Trace:
> > >  
> > >  __dump_stack lib/dump_stack.c:77 [inline]
> > >  dump_stack+0xef/0x16e lib/dump_stack.c:118
> > >  print_address_description.constprop.0.cold+0xd3/0x314 
> > > mm/kasan/report.c:374
> > >  __kasan_report.cold+0x37/0x77 mm/kasan/report.c:506
> > >  kasan_report+0xe/0x20 mm/kasan/common.c:641
> > >  check_memory_region_inline mm/kasan/generic.c:185 [inline]
> > >  check_memory_region+0x152/0x1c0 mm/kasan/generic.c:192
> > >  memcpy+0x20/0x50 mm/kasan/common.c:127
> > >  memcpy include/linux/string.h:381 [inline]
> > >  skb_put_data include/linux/skbuff.h:2284 [inline]
> > >  hfa384x_int_rxmonitor drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
> > >  hfa384x_usbin_rx drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
> > >  hfa384x_usbin_callback+0x1993/0x2360 
> > > drivers/staging/wlan-ng/hfa384x_usb.c:3026
> > >  __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
> > >  usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
> > >  dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966
> > >  call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404
> > >  expire_timers kernel/time/timer.c:1449 [inline]
> > >  __run_timers kernel/time/timer.c:1773 [inline]
> > >  __run_timers kernel/time/timer.c:1740 [inline]
> > >  run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786
> > >  __do_softirq+0x21e/0x950 kernel/softirq.c:292
> > >  invoke_softirq kernel/softirq.c:373 [inline]
> > >  irq_exit+0x178/0x1a0 kernel/softirq.c:413
> > >  exiting_irq arch/x86/include/asm/apic.h:546 [inline]
> > >  smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146
> > >  apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
> > >  
> > > RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 
> > > [inline]
> > > RIP: 0010:__raw_spin_unlock_irqrestore 
> > > include/linux/spinlock_api_smp.h:160 [inline]
> > > RIP: 0010:_raw_spin_unlock_irqrestore+0x3b/0x40 
> > > kernel/locking/spinlock.c:191
> > > Code: e8 2a e8 96 fb 48 89 ef e8 f2 c9 97 fb f6 c7 02 75 11 53 9d e8 16 
> > > 50 b5 fb 65 ff 0d f7 bd 72 7a 5b 5d c3 e8 07 4e b5 fb 53 9d  ed 0f 1f 
> > > 00 55 48 89 fd 65 ff 05 dd bd 72 7a 45 31 c9 41 b8 01
> > > RSP: 0018:8881d56b6f40 EFLAGS: 0293 ORIG_RAX: ff13
> > > RAX: 0007 RBX: 0293 RCX: 0006
> > > RDX:  RSI: 8881d56a88f0 RDI: 8881d56a884c
> > > RBP: 8881c0c64b80 R08: 8881d56a8000 R09: fbfff1266e8f
> > > R10: fbfff1266e8e R11: 89337477 R12: 
> > > R13: 8881c0c64bb8 R14: 8881c0c64b80 R15: 8881c0c64bb8
> > >  hfa384x_usbctlx_submit+0x1cb/0x260 
> > > drivers/staging/wlan-ng/hfa384x_usb.c:3834
> > >  hfa384x_docmd drivers/staging/wlan-ng/hfa384x_usb.c:1233 [inline]
> > >  hfa384x_cmd_initialize+0x290/0x4f0 
> > > drivers/staging/wlan-ng/hfa384x_usb.c:846
> > >  hfa384x_drvr_start+0x1f1/0x480 drivers/staging/wlan-ng/hfa384x_usb.c:2380
> > >  prism2sta_ifstate+0x24e/0x510 drivers/staging/wlan-ng/prism2sta.c:471
> > >  prism2sta_probe_usb.cold+0x1c8/0x49e 
> > > drivers/staging/wlan-ng/prism2usb.c:112
> > >  usb_probe_interface+0x310/0x800 drivers/usb/core/driver.c:374
> > >  really_probe+0x290/0xac0 drivers/base/dd.c:551
> > >  driver_probe_device+0x223/0x350 drivers/base/dd.c:724
> > >  __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:831
> > >  bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
> > >  __device_attach+0x217/0x390 drivers/base/dd.c:897
> > >  bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
> > >  device_add+0x1459/0x1bf0 drivers/base/core.c:2500
> > >  usb_set_configuration+0xe47/0x17d0 drivers/usb/core/message.c:2023
> > 

Re: KASAN: slab-out-of-bounds Read in hfa384x_usbin_callback

2020-03-25 Thread Qiujun Huang
On Wed, Mar 25, 2020 at 9:13 PM Hillf Danton  wrote:
>
>
> On Wed, 25 Mar 2020 01:58:03 -0700
> > syzbot has tested the proposed patch but the reproducer still triggered 
> > crash:
> > KASAN: use-after-free Read in hfa384x_usbin_callback
> >
> > ==
> > BUG: KASAN: use-after-free in memcpy include/linux/string.h:381 [inline]
> > BUG: KASAN: use-after-free in skb_put_data include/linux/skbuff.h:2284 
> > [inline]
> > BUG: KASAN: use-after-free in hfa384x_int_rxmonitor 
> > drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
> > BUG: KASAN: use-after-free in hfa384x_usbin_rx 
> > drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
> > BUG: KASAN: use-after-free in hfa384x_usbin_callback+0x1993/0x2360 
> > drivers/staging/wlan-ng/hfa384x_usb.c:3026
> > Read of size 19671 at addr 8881cda7b33c by task kworker/1:2/95
> >
> > CPU: 1 PID: 95 Comm: kworker/1:2 Not tainted 5.6.0-rc5-syzkaller #0
> > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS 
> > Google 01/01/2011
> > Workqueue: usb_hub_wq hub_event
> > Call Trace:
> >  
> >  __dump_stack lib/dump_stack.c:77 [inline]
> >  dump_stack+0xef/0x16e lib/dump_stack.c:118
> >  print_address_description.constprop.0.cold+0xd3/0x314 mm/kasan/report.c:374
> >  __kasan_report.cold+0x37/0x77 mm/kasan/report.c:506
> >  kasan_report+0xe/0x20 mm/kasan/common.c:641
> >  check_memory_region_inline mm/kasan/generic.c:185 [inline]
> >  check_memory_region+0x152/0x1c0 mm/kasan/generic.c:192
> >  memcpy+0x20/0x50 mm/kasan/common.c:127
> >  memcpy include/linux/string.h:381 [inline]
> >  skb_put_data include/linux/skbuff.h:2284 [inline]
> >  hfa384x_int_rxmonitor drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
> >  hfa384x_usbin_rx drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
> >  hfa384x_usbin_callback+0x1993/0x2360 
> > drivers/staging/wlan-ng/hfa384x_usb.c:3026
> >  __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
> >  usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
> >  dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966
> >  call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404
> >  expire_timers kernel/time/timer.c:1449 [inline]
> >  __run_timers kernel/time/timer.c:1773 [inline]
> >  __run_timers kernel/time/timer.c:1740 [inline]
> >  run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786
> >  __do_softirq+0x21e/0x950 kernel/softirq.c:292
> >  invoke_softirq kernel/softirq.c:373 [inline]
> >  irq_exit+0x178/0x1a0 kernel/softirq.c:413
> >  exiting_irq arch/x86/include/asm/apic.h:546 [inline]
> >  smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146
> >  apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
> >  
> > RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline]
> > RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 
> > [inline]
> > RIP: 0010:_raw_spin_unlock_irqrestore+0x3b/0x40 
> > kernel/locking/spinlock.c:191
> > Code: e8 2a e8 96 fb 48 89 ef e8 f2 c9 97 fb f6 c7 02 75 11 53 9d e8 16 50 
> > b5 fb 65 ff 0d f7 bd 72 7a 5b 5d c3 e8 07 4e b5 fb 53 9d  ed 0f 1f 00 
> > 55 48 89 fd 65 ff 05 dd bd 72 7a 45 31 c9 41 b8 01
> > RSP: 0018:8881d56b6f40 EFLAGS: 0293 ORIG_RAX: ff13
> > RAX: 0007 RBX: 0293 RCX: 0006
> > RDX:  RSI: 8881d56a88f0 RDI: 8881d56a884c
> > RBP: 8881c0c64b80 R08: 8881d56a8000 R09: fbfff1266e8f
> > R10: fbfff1266e8e R11: 89337477 R12: 
> > R13: 8881c0c64bb8 R14: 8881c0c64b80 R15: 8881c0c64bb8
> >  hfa384x_usbctlx_submit+0x1cb/0x260 
> > drivers/staging/wlan-ng/hfa384x_usb.c:3834
> >  hfa384x_docmd drivers/staging/wlan-ng/hfa384x_usb.c:1233 [inline]
> >  hfa384x_cmd_initialize+0x290/0x4f0 
> > drivers/staging/wlan-ng/hfa384x_usb.c:846
> >  hfa384x_drvr_start+0x1f1/0x480 drivers/staging/wlan-ng/hfa384x_usb.c:2380
> >  prism2sta_ifstate+0x24e/0x510 drivers/staging/wlan-ng/prism2sta.c:471
> >  prism2sta_probe_usb.cold+0x1c8/0x49e 
> > drivers/staging/wlan-ng/prism2usb.c:112
> >  usb_probe_interface+0x310/0x800 drivers/usb/core/driver.c:374
> >  really_probe+0x290/0xac0 drivers/base/dd.c:551
> >  driver_probe_device+0x223/0x350 drivers/base/dd.c:724
> >  __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:831
> >  bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
> >  __device_attach+0x217/0x390 drivers/base/dd.c:897
> >  bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
> >  device_add+0x1459/0x1bf0 drivers/base/core.c:2500
> >  usb_set_configuration+0xe47/0x17d0 drivers/usb/core/message.c:2023
> >  usb_generic_driver_probe+0x9d/0xe0 drivers/usb/core/generic.c:241
> >  usb_probe_device+0xd9/0x230 drivers/usb/core/driver.c:272
> >  really_probe+0x290/0xac0 drivers/base/dd.c:551
> >  driver_probe_device+0x223/0x350 drivers/base/dd.c:724
> >  __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:831
> >  

[driver-core:driver-core-next] BUILD SUCCESS c442a0d18744d4a5857d513f171d68ed6a54df5b

2020-03-25 Thread kbuild test robot
tree/branch: 
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git  
driver-core-next
branch HEAD: c442a0d18744d4a5857d513f171d68ed6a54df5b  driver core: Set 
fw_devlink to "permissive" behavior by default

elapsed time: 2224m

configs tested: 233
configs skipped: 0

The following configs have been built successfully.
More configs may be tested in the coming days.

arm  allmodconfig
arm   allnoconfig
arm  allyesconfig
arm64allmodconfig
arm64 allnoconfig
arm64allyesconfig
arm at91_dt_defconfig
arm   efm32_defconfig
arm  exynos_defconfig
armmulti_v5_defconfig
armmulti_v7_defconfig
armshmobile_defconfig
arm   sunxi_defconfig
arm64   defconfig
sparcallyesconfig
microblazenommu_defconfig
h8300   h8s-sim_defconfig
m68k   sun3_defconfig
s390 allyesconfig
mips allyesconfig
s390  allnoconfig
shtitan_defconfig
riscvallmodconfig
riscv allnoconfig
sparc64   allnoconfig
ia64defconfig
powerpc defconfig
i386  allnoconfig
i386 allyesconfig
i386 alldefconfig
i386defconfig
ia64 alldefconfig
ia64 allmodconfig
ia64  allnoconfig
ia64 allyesconfig
nios2 3c120_defconfig
nios2 10m50_defconfig
c6xevmc6678_defconfig
xtensa  iss_defconfig
c6x  allyesconfig
xtensa   common_defconfig
openrisc simple_smp_defconfig
openriscor1ksim_defconfig
alpha   defconfig
cskydefconfig
nds32 allnoconfig
nds32   defconfig
h8300 edosk2674_defconfig
h8300h8300h-sim_defconfig
m68k allmodconfig
m68k   m5475evb_defconfig
m68k  multi_defconfig
arc  allyesconfig
arc defconfig
microblaze  mmu_defconfig
powerpc   allnoconfig
powerpc   ppc64_defconfig
powerpc  rhel-kconfig
mips   32r2_defconfig
mips 64r6el_defconfig
mips allmodconfig
mips  allnoconfig
mips  fuloong2e_defconfig
mips  malta_kvm_defconfig
pariscallnoconfig
parisc   allyesconfig
pariscgeneric-32bit_defconfig
pariscgeneric-64bit_defconfig
x86_64   randconfig-a001-20200324
x86_64   randconfig-a002-20200324
x86_64   randconfig-a003-20200324
i386 randconfig-a001-20200324
i386 randconfig-a002-20200324
i386 randconfig-a003-20200324
x86_64   randconfig-a001-20200325
x86_64   randconfig-a002-20200325
x86_64   randconfig-a003-20200325
i386 randconfig-a001-20200325
i386 randconfig-a002-20200325
i386 randconfig-a003-20200325
alpharandconfig-a001-20200325
m68k randconfig-a001-20200325
mips randconfig-a001-20200325
nds32randconfig-a001-20200325
parisc   randconfig-a001-20200325
riscvrandconfig-a001-20200325
alpharandconfig-a001-20200324
m68k randconfig-a001-20200324
mips randconfig-a001-20200324
nds32randconfig-a001-20200324
parisc   randconfig-a001-20200324
riscvrandconfig-a001-20200324
c6x  randconfig-a001-20200324
h8300randconfig-a001-20200324
microblaze   randconfig-a001-20200324
nios2randconfig-a001-20200324
sparc64  randconfig-a001-20200324
c6x  randconfig-a001-20200325
h8300randconfig-a001-20200325
microblaze   randconfig-a001-2020

Re: [PATCH] staging: rtl8188eu: cleanup long line in odm.c

2020-03-25 Thread Joe Perches
On Wed, 2020-03-25 at 22:59 +0100, Michael Straube wrote:
> Cleanup line over 80 characters by removing unnecessary parentheses.
[]
> diff --git a/drivers/staging/rtl8188eu/hal/odm.c 
> b/drivers/staging/rtl8188eu/hal/odm.c
[]
> @@ -590,7 +590,7 @@ void odm_CCKPacketDetectionThresh(struct odm_dm_struct 
> *pDM_Odm)
>   if (pDM_Odm->bLinked) {
>   if (pDM_Odm->RSSI_Min > 25) {
>   CurCCK_CCAThres = 0xcd;
> - } else if ((pDM_Odm->RSSI_Min <= 25) && (pDM_Odm->RSSI_Min > 
> 10)) {
> + } else if (pDM_Odm->RSSI_Min <= 25 && pDM_Odm->RSSI_Min > 10) {

The test above this already guarantees pDM_Odm->RSSI_Min <= 25
so the block could be written just

} else if (pDM->RSSI_Min > 10) {

>   CurCCK_CCAThres = 0x83;
>   } else {
>   if (FalseAlmCnt->Cnt_Cck_fail > 1000)

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Please Help The needy

2020-03-25 Thread Ms. Reem
My name is Reem E. Al-Hashimi, the Emirates Minister of State and Managing 
Director of United Arab Emirates (Dubai) World Expo 2020 Committee. I am 
writing you to stand as my partner to receive my share of gratification from 
foreign companies whom I helped during the bidding exercise towards the Dubai 
World Expo 2020 Committee and also i want to use this funds assist Corona virus 
Symptoms and Causes.

Am a single Arab women and serving as a minister, there is a limit to my 
personal income and investment level and  For this reason, I cannot receive 
such a huge sum back to my country or my personal account, so an agreement was 
reached with the foreign companies to direct the gratifications to an open 
beneficiary account with a financial institution where it will be possible for 
me to instruct further transfer of the fund to a third party account for 
investment purpose which is the reason i contacted you to receive the fund as 
my partner for investment in your country.

The amount is valued at Euro 47,745,533.00 with a financial institution waiting 
my instruction for further transfer to a destination account as soon as I have 
your information indicating interest to receive and invest the fund, I will 
compensate you with 30% of the total amount and you will also get benefit from 
the investment.

If you can handle the fund in a good investment. reply on this email only: 
reemalhash...@daum.net
Regards,
Ms. Reem

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723bs: Clean up tests if NULL returned on failure

2020-03-25 Thread Simran Singhal
Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:
@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Simran Singhal 
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 29f36cca3972..5c27c11f006a 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -474,7 +474,7 @@ static int wpa_set_encryption(struct net_device *dev, 
struct ieee_param *param,
wep_key_len = wep_key_len <= 5 ? 5 : 13;
wep_total_len = wep_key_len + FIELD_OFFSET(struct 
ndis_802_11_wep, KeyMaterial);
pwep = kzalloc(wep_total_len, GFP_KERNEL);
-   if (pwep == NULL) {
+   if (!pwep) {
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, 
(" wpa_set_encryption: pwep allocate fail !!!\n"));
goto exit;
}
@@ -2137,7 +2137,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev,
 
param_len = sizeof(struct ieee_param) + pext->key_len;
param = kzalloc(param_len, GFP_KERNEL);
-   if (param == NULL)
+   if (!param)
return -1;
 
param->cmd = IEEE_CMD_SET_ENCRYPTION;
@@ -3491,7 +3491,7 @@ static int rtw_set_encryption(struct net_device *dev, 
struct ieee_param *param,
wep_key_len = wep_key_len <= 5 ? 5 : 13;
wep_total_len = wep_key_len + FIELD_OFFSET(struct 
ndis_802_11_wep, KeyMaterial);
pwep = kzalloc(wep_total_len, GFP_KERNEL);
-   if (pwep == NULL) {
+   if (!pwep) {
DBG_871X(" r871x_set_encryption: pwep allocate 
fail !!!\n");
goto exit;
}
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/4] media Kconfig reorg - part 2

2020-03-25 Thread Laurent Pinchart
Hi Mauro,

On Wed, Mar 25, 2020 at 10:38:20PM +0100, Mauro Carvalho Chehab wrote:
> Em Wed, 25 Mar 2020 16:36:31 -0300 Helen Koike escreveu:
> > On 3/25/20 1:03 PM, Mauro Carvalho Chehab wrote:
> > > That's the second part of media Kconfig changes. The entire series is
> > > at:
> > > 
> > >   https://git.linuxtv.org/mchehab/experimental.git/log/?h=media-kconfig  
> > 
> > I made a quick experiment (using this branch) with someone who works with 
> > the kernel for his master degree, but doesn't have much experience in 
> > kernel development in general.
> > I asked him to enable Vimc (from default configs, where multimedia starts 
> > disabled).
> > He knows that Vimc is a virtual camera driver, and this is how he behaved:
> > 
> > === Start of experiment:
> > 
> > * He pressed '/' and searched for vimc to see the location path.
> > * Then he enabled "Multimedia support" and went straight to "Media drivers" 
> > (which just shows USB and PCI).
> > * He went back to "Multimedia support", entered "Media device types" and 
> > enabled "Test drivers".
> > * He went back to "Media drivers" again and didn't find Vimc (nothing 
> > changed in this menu).
> > * He seemed a bit lost, going back and forth in the menus a couple of times.
> > * Then he pressed '/' again to search for vimc and see the location path, 
> > and he realized that there
> > should be an option called "V4L test drivers" under "Media drivers" that is 
> > not showing up.
> > * He went back to "Media device types" again and start re-reading the 
> > options.
> > * He selected "Cameras and video grabbers" ant went back to "Media drivers".
> > * He sees "V4L test drivers", selects it, and enter this menu.
> > * He selects "Virtual Media Controller Driver".
> > 
> > I asked his impressions, and he mentioned that he thought that enabling 
> > just "Test drivers" would be enough, without need
> > to combine "Test drivers" with "Cameras and video grabbers".
> > He also asked me why virtual drivers should be hidden, and he mentioned 
> > that the word "Virtual" in front would be enough.
> > 
> > Then I showed him he could have disabled the option "Filter devices by 
> > their types" to see everything at one (which he didn't
> > realized by himself until that moment, nor tried it out to see what would 
> > happen).
> > 
> > He mentioned that hiding is nice, because it shows less options, but not 
> > very nice to search for something.
> > He also mentioned that if he had understood the filter mechanism from the 
> > start, he would have disabled "Filter devices by their types" sooner.
> 
> That's easy to solve: all it needs is to add something similar
> to this at drivers/media/Kconfig:
> 
>   +   comment "Drivers are filtered by MEDIA_SUPPORT_FILTER"
>   +   visible if MEDIA_SUPPORT_FILTER
>   +
>   +   comment "All available drivers are shown below"
>   +   visible if !MEDIA_SUPPORT_FILTER
>   +
>   menu "Media drivers"
> 
>   source "drivers/media/usb/Kconfig"
> 
> > === End of experiment
> > 
> > This was just one experiment from one person, I'll see if I can get some 
> > other people from lkcamp.dev group to also check
> > and send us their impressions. I think it would be nice to get more data 
> > about user experience, from people that are not used to
> > kernel development (kernel dev newbies for instance).
> > 
> > Just another remark from me:
> > 
> > From the default config, "Media drivers" shows USB and PCI, 
> 
> Well, assuming that there are 2 billion computers, 1% with Linux
> installed, and 10% of them have a media device (camera or TV),
> we have about 2 millions of people running Linux. That excludes
> Android and Embedded devices, where people usually don't touch.
> 
> During an entire year, there are about 4000 of Kernel developers 
> that has at least one patch accepted upstream (this number
> includes developers for Android and other SoCs). Also, the 
> number of Kernel developers submitting patches upstream for the
> media subsystem is around 20-40 people along an year.

$ git log --since 2019-01-01 --until 2020-01-01 --no-merges -- drivers/media/ | 
grep '^Author: ' | sort | uniq -c | wc -l   
215

There's some duplication of e-mail addresses, but it's still roughly an
order or magnitude bigger (and it's not counting staging, headers or
documentation).

> So, about 99,9998% of the users using the media subsystems aren't
> Kernel hackers. I bet that almost all of those will either need
> to enable USB or a PCI driver.

And the extremely vast majority of these will never enable a kernel
option because they will never compile a kernel. They don't even know
what a kernel is :-)

> Granted, 99,9998% seems too optimistic, but, assuming that this
> would reduce to something like 80% (e. g. only 200 users
> would ever try to build a media driver, with is a *very conservative*
> number) this is still a lot more than the number of media Kernel
> developers.
> 
> Also, a 

[PATCH] staging: rtl8188eu: cleanup long line in odm.c

2020-03-25 Thread Michael Straube
Cleanup line over 80 characters by removing unnecessary parentheses.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/hal/odm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm.c 
b/drivers/staging/rtl8188eu/hal/odm.c
index a6eb9798b6f8..ed1a6ea0eecf 100644
--- a/drivers/staging/rtl8188eu/hal/odm.c
+++ b/drivers/staging/rtl8188eu/hal/odm.c
@@ -590,7 +590,7 @@ void odm_CCKPacketDetectionThresh(struct odm_dm_struct 
*pDM_Odm)
if (pDM_Odm->bLinked) {
if (pDM_Odm->RSSI_Min > 25) {
CurCCK_CCAThres = 0xcd;
-   } else if ((pDM_Odm->RSSI_Min <= 25) && (pDM_Odm->RSSI_Min > 
10)) {
+   } else if (pDM_Odm->RSSI_Min <= 25 && pDM_Odm->RSSI_Min > 10) {
CurCCK_CCAThres = 0x83;
} else {
if (FalseAlmCnt->Cnt_Cck_fail > 1000)
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723bs: hal: Compress return logic

2020-03-25 Thread Simran Singhal
Simplify function returns by merging assignment and return into
one command line.
Found with Coccinelle

@@
local idexpression ret;
expression e;
@@

-ret =
+return
 e;
-return ret;

Signed-off-by: Simran Singhal 
---
 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c 
b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index eb7de3617d83..767e2a784f78 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -1498,9 +1498,7 @@ s8 PHY_GetTxPowerByRate(
return value;
}
 
-   value = pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex];
-
-   return value;
+   return pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex];
 
 }
 
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/4] media Kconfig reorg - part 2

2020-03-25 Thread Mauro Carvalho Chehab
Em Wed, 25 Mar 2020 16:36:31 -0300
Helen Koike  escreveu:

> Hello,
> 
> On 3/25/20 1:03 PM, Mauro Carvalho Chehab wrote:
> > That's the second part of media Kconfig changes. The entire series is
> > at:
> > 
> > https://git.linuxtv.org/mchehab/experimental.git/log/?h=media-kconfig  
> 
> I made a quick experiment (using this branch) with someone who works with the 
> kernel for his master degree, but doesn't have much experience in kernel 
> development in general.
> I asked him to enable Vimc (from default configs, where multimedia starts 
> disabled).
> He knows that Vimc is a virtual camera driver, and this is how he behaved:
> 
> === Start of experiment:
> 
> * He pressed '/' and searched for vimc to see the location path.
> * Then he enabled "Multimedia support" and went straight to "Media drivers" 
> (which just shows USB and PCI).
> * He went back to "Multimedia support", entered "Media device types" and 
> enabled "Test drivers".
> * He went back to "Media drivers" again and didn't find Vimc (nothing changed 
> in this menu).
> * He seemed a bit lost, going back and forth in the menus a couple of times.
> * Then he pressed '/' again to search for vimc and see the location path, and 
> he realized that there
> should be an option called "V4L test drivers" under "Media drivers" that is 
> not showing up.
> * He went back to "Media device types" again and start re-reading the options.
> * He selected "Cameras and video grabbers" ant went back to "Media drivers".
> * He sees "V4L test drivers", selects it, and enter this menu.
> * He selects "Virtual Media Controller Driver".
> 
> I asked his impressions, and he mentioned that he thought that enabling just 
> "Test drivers" would be enough, without need
> to combine "Test drivers" with "Cameras and video grabbers".
> He also asked me why virtual drivers should be hidden, and he mentioned that 
> the word "Virtual" in front would be enough.
> 
> Then I showed him he could have disabled the option "Filter devices by their 
> types" to see everything at one (which he didn't
> realized by himself until that moment, nor tried it out to see what would 
> happen).
> 
> He mentioned that hiding is nice, because it shows less options, but not very 
> nice to search for something.
> He also mentioned that if he had understood the filter mechanism from the 
> start, he would have disabled "Filter devices by their types" sooner.

That's easy to solve: all it needs is to add something similar
to this at drivers/media/Kconfig:

+   comment "Drivers are filtered by MEDIA_SUPPORT_FILTER"
+   visible if MEDIA_SUPPORT_FILTER
+
+   comment "All available drivers are shown below"
+   visible if !MEDIA_SUPPORT_FILTER
+
menu "Media drivers"

source "drivers/media/usb/Kconfig"

> === End of experiment
> 
> This was just one experiment from one person, I'll see if I can get some 
> other people from lkcamp.dev group to also check
> and send us their impressions. I think it would be nice to get more data 
> about user experience, from people that are not used to
> kernel development (kernel dev newbies for instance).
> 
> Just another remark from me:
> 
> From the default config, "Media drivers" shows USB and PCI, 

Well, assuming that there are 2 billion computers, 1% with Linux
installed, and 10% of them have a media device (camera or TV),
we have about 2 millions of people running Linux. That excludes
Android and Embedded devices, where people usually don't touch.

During an entire year, there are about 4000 of Kernel developers 
that has at least one patch accepted upstream (this number
includes developers for Android and other SoCs). Also, the 
number of Kernel developers submitting patches upstream for the
media subsystem is around 20-40 people along an year.

So, about 99,9998% of the users using the media subsystems aren't
Kernel hackers. I bet that almost all of those will either need
to enable USB or a PCI driver.

Granted, 99,9998% seems too optimistic, but, assuming that this
would reduce to something like 80% (e. g. only 200 users
would ever try to build a media driver, with is a *very conservative*
number) this is still a lot more than the number of media Kernel
developers.

Also, a Kernel hacker will sooner or later find a way to enable it.
A normal user may find it a lot more trickier and will very likely
require more support, if the menus are too technical and the
default options are wrong.

-

Even with that, based on your small experiment (of someone from the
area), I suspect that, if you had asked him to enable, for example,
em28xx or dvbsky (with are some of the most popular drivers
those days), he would be able to enable it a lot faster.

> and selecting those doesn't do anything, and people can even think
> that, if they want to enable an USB device, just enabling the USB option 
> there is enough (which is not), since no drivers
> shows up.

It is hard 

[PATCH] staging: rtl8723bs: rtw_cmd: Compress lines for immediate return

2020-03-25 Thread Simran Singhal
Compress two lines into a single line if immediate return statement is found.
It also removes variable cmd_obj as it is no longer needed.

It is done using script Coccinelle.
And coccinelle uses following semantic patch for this compression function:

@@
expression ret;
identifier f;
@@

-ret =
+return
 f(...);
-return ret;

Signed-off-by: Simran Singhal 
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c 
b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index 744b40dd4cf0..42b0ea8abd9c 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -362,11 +362,7 @@ int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct 
cmd_obj *cmd_obj)
 
 struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv)
 {
-   struct cmd_obj *cmd_obj;
-
-   cmd_obj = _rtw_dequeue_cmd(>cmd_queue);
-
-   return cmd_obj;
+   return _rtw_dequeue_cmd(>cmd_queue);
 }
 
 void rtw_free_cmd_obj(struct cmd_obj *pcmd)
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723bs: rtw_efuse: Compress lines for immediate return

2020-03-25 Thread Simran Singhal
Compress two lines into a single line if immediate return statement is found.

It is done using script Coccinelle. And coccinelle uses following semantic
patch for this compression function:

@@
expression ret;
identifier f;
@@

-ret =
+return
 f(...);
-return ret;

Signed-off-by: Simran Singhal 
---
 drivers/staging/rtl8723bs/core/rtw_efuse.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_efuse.c 
b/drivers/staging/rtl8723bs/core/rtw_efuse.c
index de7d15fdc936..8794638468e6 100644
--- a/drivers/staging/rtl8723bs/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723bs/core/rtw_efuse.c
@@ -266,8 +266,7 @@ boolbPseudoTest)
/* DBG_871X("===> EFUSE_OneByteRead() start, 0x34 = 0x%X\n", 
rtw_read32(padapter, EFUSE_TEST)); */
 
if (bPseudoTest) {
-   bResult = Efuse_Read1ByteFromFakeContent(padapter, addr, data);
-   return bResult;
+   return Efuse_Read1ByteFromFakeContent(padapter, addr, data);
}
 
/*  <20130121, Kordan> For SMIC EFUSE specificatoin. */
@@ -319,8 +318,7 @@ boolbPseudoTest)
/* DBG_871X("===> EFUSE_OneByteWrite() start, 0x34 = 0x%X\n", 
rtw_read32(padapter, EFUSE_TEST)); */
 
if (bPseudoTest) {
-   bResult = Efuse_Write1ByteToFakeContent(padapter, addr, data);
-   return bResult;
+   return Efuse_Write1ByteToFakeContent(padapter, addr, data);
}
 
 
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Please Help The needy

2020-03-25 Thread Ms. Reem
My name is Reem E. Al-Hashimi, the Emirates Minister of State and Managing 
Director of United Arab Emirates (Dubai) World Expo 2020 Committee. I am 
writing you to stand as my partner to receive my share of gratification from 
foreign companies whom I helped during the bidding exercise towards the Dubai 
World Expo 2020 Committee and also i want to use this funds assist Corona virus 
Symptoms and Causes.

Am a single Arab women and serving as a minister, there is a limit to my 
personal income and investment level and  For this reason, I cannot receive 
such a huge sum back to my country or my personal account, so an agreement was 
reached with the foreign companies to direct the gratifications to an open 
beneficiary account with a financial institution where it will be possible for 
me to instruct further transfer of the fund to a third party account for 
investment purpose which is the reason i contacted you to receive the fund as 
my partner for investment in your country.

The amount is valued at Euro 47,745,533.00 with a financial institution waiting 
my instruction for further transfer to a destination account as soon as I have 
your information indicating interest to receive and invest the fund, I will 
compensate you with 30% of the total amount and you will also get benefit from 
the investment.

If you can handle the fund in a good investment. reply on this email only: 
reemalhash...@daum.net
Regards,
Ms. Reem

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/4] media Kconfig reorg - part 2

2020-03-25 Thread Helen Koike
Hello,

On 3/25/20 1:03 PM, Mauro Carvalho Chehab wrote:
> That's the second part of media Kconfig changes. The entire series is
> at:
> 
>   https://git.linuxtv.org/mchehab/experimental.git/log/?h=media-kconfig

I made a quick experiment (using this branch) with someone who works with the 
kernel for his master degree, but doesn't have much experience in kernel 
development in general.
I asked him to enable Vimc (from default configs, where multimedia starts 
disabled).
He knows that Vimc is a virtual camera driver, and this is how he behaved:

=== Start of experiment:

* He pressed '/' and searched for vimc to see the location path.
* Then he enabled "Multimedia support" and went straight to "Media drivers" 
(which just shows USB and PCI).
* He went back to "Multimedia support", entered "Media device types" and 
enabled "Test drivers".
* He went back to "Media drivers" again and didn't find Vimc (nothing changed 
in this menu).
* He seemed a bit lost, going back and forth in the menus a couple of times.
* Then he pressed '/' again to search for vimc and see the location path, and 
he realized that there
should be an option called "V4L test drivers" under "Media drivers" that is not 
showing up.
* He went back to "Media device types" again and start re-reading the options.
* He selected "Cameras and video grabbers" ant went back to "Media drivers".
* He sees "V4L test drivers", selects it, and enter this menu.
* He selects "Virtual Media Controller Driver".

I asked his impressions, and he mentioned that he thought that enabling just 
"Test drivers" would be enough, without need
to combine "Test drivers" with "Cameras and video grabbers".
He also asked me why virtual drivers should be hidden, and he mentioned that 
the word "Virtual" in front would be enough.

Then I showed him he could have disabled the option "Filter devices by their 
types" to see everything at one (which he didn't
realized by himself until that moment, nor tried it out to see what would 
happen).

He mentioned that hiding is nice, because it shows less options, but not very 
nice to search for something.
He also mentioned that if he had understood the filter mechanism from the 
start, he would have disabled "Filter devices by their types" sooner.

=== End of experiment

This was just one experiment from one person, I'll see if I can get some other 
people from lkcamp.dev group to also check
and send us their impressions. I think it would be nice to get more data about 
user experience, from people that are not used to
kernel development (kernel dev newbies for instance).

Just another remark from me:

>From the default config, "Media drivers" shows USB and PCI, and selecting 
>those doesn't do anything, and people can even think
that, if they want to enable an USB device, just enabling the USB option there 
is enough (which is not), since no drivers
shows up.

I hope this helps
Helen


> 
> It addresses some issues I noticed when reviewing the series, and do
> some changes on how things will be displayed.
> 
> It also simplify dependencencies on media-controller-dependent drivers,
> by auto-selecting the needed deps.
> 
> It should be noticed that the media controller may also optionally
> selected for several other drivers, so there is still a prompt to allow
> manually enabling it, in the case it was not auto-selected.
> 
> PS.: While not needed anymore, because all dependent drivers auto
> select, at least for now, I opted to keep the prompt for:
> 
> - VIDEO_V4L2_SUBDEV_API
> 
>   The rationale is that there are a few drivers that can optionally depend
>   on it (like tvp5150). So, better to keep the dependency, in order to be
>   able to test those drivers with and without the option.
> 
> - MEDIA_CONTROLLER_REQUEST_API
> 
>   The rationale is that there are some warnings at the Request API, and
>   it would be good to keep it, at least while drivers are on staging.
> 
> Mauro Carvalho Chehab (4):
>   media: dvb-core: Kconfig: default to use dynamic minors
>   media: Kconfig files: use select for V4L2 subdevs and MC
>   media: i2c/Kconfig: reorganize items there
>   media: Kconfig: don't use visible for device type select
> 
>  drivers/media/Kconfig |  25 +-
>  drivers/media/dvb-core/Kconfig|   1 +
>  drivers/media/i2c/Kconfig | 406 +++---
>  drivers/media/i2c/et8ek8/Kconfig  |   4 +-
>  drivers/media/i2c/m5mols/Kconfig  |   5 +-
>  drivers/media/i2c/smiapp/Kconfig  |   5 +-
>  drivers/media/pci/cobalt/Kconfig  |   4 +-
>  drivers/media/pci/intel/ipu3/Kconfig  |   4 +-
>  drivers/media/pci/sta2x11/Kconfig |   6 +-
>  drivers/media/platform/Kconfig|  28 +-
>  drivers/media/platform/am437x/Kconfig |   4 +-
>  drivers/media/platform/atmel/Kconfig  |   4 +-
>  drivers/media/platform/cadence/Kconfig|   8 +-
>  drivers/media/platform/exynos4-is/Kconfig   

[PATCH] staging: rtl8723bs: Remove blank line before '}' brace

2020-03-25 Thread Simran Singhal
Remove unneeded blank line before a close brace '}'.
Issue found by checkpatch.pl:
CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Simran Singhal 
---
 drivers/staging/rtl8723bs/core/rtw_security.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c 
b/drivers/staging/rtl8723bs/core/rtw_security.c
index 9c4607114cea..5ebf691bd743 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -434,7 +434,6 @@ void rtw_seccalctkipmic(u8 *key, u8 *header, u8 *data, u32 
data_len, u8 *mic_cod
rtw_secmicappend(, [16], 6);
else
rtw_secmicappend(, [10], 6);
-
}
rtw_secmicappend(, [0], 4);
 
@@ -723,7 +722,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 
*pxmitframe)
 
TKIP_SW_ENC_CNT_INC(psecuritypriv, pattrib->ra);
}
-
}
return res;
 }
@@ -829,11 +827,9 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 
*precvframe)
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("%s: 
stainfo == NULL!!!\n", __func__));
res = _FAIL;
}
-
}
 exit:
return res;
-
 }
 
 
@@ -1219,7 +1215,6 @@ static void construct_mic_header2(
if (!qc_exists && a4_exists) {
for (i = 0; i < 6; i++)
mic_header2[8+i] = mpdu[24+i];   /* A4 */
-
}
 
if (qc_exists && !a4_exists) {
@@ -1234,7 +1229,6 @@ static void construct_mic_header2(
mic_header2[14] = mpdu[30] & 0x0f;
mic_header2[15] = mpdu[31] & 0x00;
}
-
 }
 
 //
@@ -1413,7 +1407,6 @@ static sint aes_cipher(u8 *key, uint  hdrlen,
}
bitwise_xor(aes_out, padded_buffer, chain_buffer);
aes128k128d(key, chain_buffer, aes_out);
-
}
 
for (j = 0 ; j < 8; j++)
@@ -1719,7 +1712,6 @@ static sint aes_decipher(u8 *key, uinthdrlen,
}
bitwise_xor(aes_out, padded_buffer, chain_buffer);
aes128k128d(key, chain_buffer, aes_out);
-
}
 
for (j = 0; j < 8; j++)
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[driver-core:driver-core-testing] BUILD SUCCESS be6ca6a7ec4c8d6dd9fe712a798d32a7c19cb04a

2020-03-25 Thread kbuild test robot
tree/branch: 
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git  
driver-core-testing
branch HEAD: be6ca6a7ec4c8d6dd9fe712a798d32a7c19cb04a  nvmem: core: use 
device_register and device_unregister

elapsed time: 1396m

configs tested: 158
configs skipped: 0

The following configs have been built successfully.
More configs may be tested in the coming days.

arm64 allnoconfig
arm   allnoconfig
arm at91_dt_defconfig
arm   efm32_defconfig
arm  exynos_defconfig
armmulti_v5_defconfig
armmulti_v7_defconfig
armshmobile_defconfig
arm   sunxi_defconfig
arm64   defconfig
pariscgeneric-64bit_defconfig
powerpc   ppc64_defconfig
s390 alldefconfig
sparc   defconfig
um i386_defconfig
pariscallnoconfig
sparc64  allyesconfig
arm  allyesconfig
nds32   defconfig
s390defconfig
i386defconfig
m68k   m5475evb_defconfig
ia64  allnoconfig
alpha   defconfig
sparc64 defconfig
ia64 alldefconfig
sh  rsk7269_defconfig
i386 allyesconfig
i386 alldefconfig
i386  allnoconfig
ia64 allmodconfig
ia64 allyesconfig
ia64defconfig
arm  allmodconfig
arm64allmodconfig
c6x  allyesconfig
c6xevmc6678_defconfig
nios2 10m50_defconfig
nios2 3c120_defconfig
openriscor1ksim_defconfig
openrisc simple_smp_defconfig
xtensa   common_defconfig
xtensa  iss_defconfig
nds32 allnoconfig
cskydefconfig
h8300 edosk2674_defconfig
h8300h8300h-sim_defconfig
h8300   h8s-sim_defconfig
m68k allmodconfig
m68k  multi_defconfig
m68k   sun3_defconfig
arc defconfig
arc  allyesconfig
powerpc  rhel-kconfig
microblaze  mmu_defconfig
microblazenommu_defconfig
powerpc   allnoconfig
mips   32r2_defconfig
mips 64r6el_defconfig
mips allmodconfig
mips  allnoconfig
mips allyesconfig
mips  fuloong2e_defconfig
mips  malta_kvm_defconfig
parisc   allyesconfig
pariscgeneric-32bit_defconfig
x86_64   randconfig-a001-20200324
x86_64   randconfig-a002-20200324
x86_64   randconfig-a003-20200324
i386 randconfig-a001-20200324
i386 randconfig-a002-20200324
i386 randconfig-a003-20200324
alpharandconfig-a001-20200324
m68k randconfig-a001-20200324
mips randconfig-a001-20200324
nds32randconfig-a001-20200324
parisc   randconfig-a001-20200324
riscvrandconfig-a001-20200324
h8300randconfig-a001-20200324
microblaze   randconfig-a001-20200324
nios2randconfig-a001-20200324
c6x  randconfig-a001-20200324
sparc64  randconfig-a001-20200324
csky randconfig-a001-20200324
openrisc randconfig-a001-20200324
s390 randconfig-a001-20200324
xtensa   randconfig-a001-20200324
i386 randconfig-b003-20200324
i386 randconfig-b001-20200324
i386 randconfig-b002-20200324
x86_64   randconfig-b001-20200324
x86_64   randconfig-c001-20200324
x86_64   randconfig-c002-20200324
x86_64   randconfig-c003-20200324
i386 randconfig-c001-20200324
i386 randconfig-c002-20200324
i386 randconfig-c003-20200324
i386 randconfig-d003-20200324
i386 randconfig-d001-20200324
x86_64   randconfig-d002-20200324
x86_64 

[PATCH] staging: rtl8723bs: Add line after variable declarations

2020-03-25 Thread Simran Singhal
Add whiteline after variable declarations to remove the checkpatch.pl
warning:
WARNING: Missing a blank line after declarations

Signed-off-by: Simran Singhal 
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index c642825ca8ef..8f9da1d49343 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -219,6 +219,7 @@ static RT_CHANNEL_PLAN_MAP 
RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03, 0x02};
 int rtw_ch_set_search_ch(RT_CHANNEL_INFO *ch_set, const u32 ch)
 {
int i;
+
for (i = 0; ch_set[i].ChannelNum != 0; i++) {
if (ch == ch_set[i].ChannelNum)
break;
@@ -2184,6 +2185,7 @@ unsigned int OnAction_sa_query(struct adapter *padapter, 
union recv_frame *precv
}
if (0) {
int pp;
+
printk("pattrib->pktlen = %d =>", pattrib->pkt_len);
for (pp = 0; pp < pattrib->pkt_len; pp++)
printk(" %02x ", pframe[pp]);
@@ -2486,6 +2488,7 @@ void issue_beacon(struct adapter *padapter, int 
timeout_ms)
/* DBG_871X("ie len =%d\n", cur_network->IELength); */
{
int len_diff;
+
memcpy(pframe, cur_network->IEs, cur_network->IELength);
len_diff = update_hidden_ssid(
pframe+_BEACON_IE_OFFSET_
@@ -2500,6 +2503,7 @@ void issue_beacon(struct adapter *padapter, int 
timeout_ms)
u8 *wps_ie;
uint wps_ielen;
u8 sr = 0;
+
wps_ie = 
rtw_get_wps_ie(pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct 
ieee80211_hdr_3addr)+_BEACON_IE_OFFSET_,
pattrib->pktlen-sizeof(struct 
ieee80211_hdr_3addr)-_BEACON_IE_OFFSET_, NULL, _ielen);
if (wps_ie && wps_ielen > 0) {
@@ -2700,6 +2704,7 @@ void issue_probersp(struct adapter *padapter, unsigned 
char *da, u8 is_valid_p2p
if (ssid_ie &&  cur_network->Ssid.SsidLength) {
uint remainder_ielen;
u8 *remainder_ie;
+
remainder_ie = ssid_ie+2;
remainder_ielen = (pframe-remainder_ie);
 
@@ -4280,6 +4285,7 @@ void site_survey(struct adapter *padapter)
 
{
struct rtw_ieee80211_channel *ch;
+
if (pmlmeext->sitesurvey_res.channel_idx < 
pmlmeext->sitesurvey_res.ch_num) {
ch = 
>sitesurvey_res.ch[pmlmeext->sitesurvey_res.channel_idx];
survey_channel = ch->hw_value;
@@ -4323,6 +4329,7 @@ void site_survey(struct adapter *padapter)
if (ScanType == SCAN_ACTIVE) { /* obey the channel plan 
setting... */
{
int i;
+
for (i = 0; i < RTW_SSID_SCAN_AMOUNT; i++) {
if 
(pmlmeext->sitesurvey_res.ssid[i].SsidLength) {
/* IOT issue, When wifi_spec is 
not set, send one probe req without WPS IE. */
@@ -4351,6 +4358,7 @@ void site_survey(struct adapter *padapter)
 #if defined(CONFIG_SIGNAL_DISPLAY_DBM) && 
defined(CONFIG_BACKGROUND_NOISE_MONITOR)
{
struct noise_info info;
+
info.bPauseDIG = false;
info.IGIValue = 0;
info.max_time = channel_scan_time_ms/2;/* ms */
@@ -4518,6 +4526,7 @@ u8 collect_bss_info(struct adapter *padapter, union 
recv_frame *precv_frame, str
p = rtw_get_ie(bssid->IEs + ie_offset, _HT_ADD_INFO_IE_, , 
bssid->IELength - ie_offset);
if (p) {
struct HT_info_element *HT_info = (struct 
HT_info_element *)(p + 2);
+
bssid->Configuration.DSConfig = 
HT_info->primary_channel;
} else { /*  use current channel */
bssid->Configuration.DSConfig = 
rtw_get_oper_ch(padapter);
@@ -4551,6 +4560,7 @@ u8 collect_bss_info(struct adapter *padapter, union 
recv_frame *precv_frame, str
p = rtw_get_ie(bssid->IEs + ie_offset, _HT_CAPABILITY_IE_, 
, bssid->IELength - ie_offset);
if (p && len > 0) {
struct HT_caps_element  *pHT_caps;
+
pHT_caps = (struct HT_caps_element  *)(p + 2);
 
if 
(le16_to_cpu(pHT_caps->u.HT_cap_element.HT_caps_info) & BIT(14))
@@ -4584,6 +4594,7 @@ void start_create_ibss(struct adapter *padapter)
struct mlme_ext_priv *pmlmeext = >mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
  

[PATCH] staging: wilc1000: remove label from examples in DT binding documentation

2020-03-25 Thread Ajay.Kathat
From: Ajay Singh 

Remove labels and not relevant property from DT binding documentation
examples as suggested in [1].

1. https://patchwork.ozlabs.org/patch/1252837

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/microchip,wilc1000.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/microchip,wilc1000.yaml 
b/drivers/staging/wilc1000/microchip,wilc1000.yaml
index bc6cc5d3f347..2c320eb2a8c4 100644
--- a/drivers/staging/wilc1000/microchip,wilc1000.yaml
+++ b/drivers/staging/wilc1000/microchip,wilc1000.yaml
@@ -36,10 +36,9 @@ required:
 
 examples:
   - |
-spi1: spi@fc018000 {
+spi {
   #address-cells = <1>;
   #size-cells = <0>;
-  cs-gpios = < 21 0>;
   wifi@0 {
 compatible = "microchip,wilc1000";
 spi-max-frequency = <4800>;
@@ -52,7 +51,7 @@ examples:
 };
 
   - |
-mmc1: mmc@fc00 {
+mmc {
   #address-cells = <1>;
   #size-cells = <0>;
   pinctrl-names = "default";
-- 
2.24.0
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] media: Kconfig files: use select for V4L2 subdevs and MC

2020-03-25 Thread Mauro Carvalho Chehab
There are lots of drivers that only work when the media controller
and/or the V4L2 subdev APIs are present.

Right now, someone need to first enable those APIs before
using those drivers.

Well, ideally, drivers, should, instead *optionally*
depend on it, in order for PC camera drivers to be able to use
them, but nowadays most drivers are UVC cameras, with don't
require a sensor driver.

So, be it.

Let's instead make them select the MEDIA_CONTROLLER and the
SUBDEV API, in order to make easier for people to be able
of enabling them.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/i2c/Kconfig | 210 --
 drivers/media/i2c/et8ek8/Kconfig  |   4 +-
 drivers/media/i2c/m5mols/Kconfig  |   5 +-
 drivers/media/i2c/smiapp/Kconfig  |   5 +-
 drivers/media/pci/cobalt/Kconfig  |   4 +-
 drivers/media/pci/intel/ipu3/Kconfig  |   4 +-
 drivers/media/pci/sta2x11/Kconfig |   6 +-
 drivers/media/platform/Kconfig|  28 ++-
 drivers/media/platform/am437x/Kconfig |   4 +-
 drivers/media/platform/atmel/Kconfig  |   4 +-
 drivers/media/platform/cadence/Kconfig|   8 +-
 drivers/media/platform/exynos4-is/Kconfig |   5 +-
 drivers/media/platform/rcar-vin/Kconfig   |   8 +-
 .../media/platform/sunxi/sun4i-csi/Kconfig|   4 +-
 .../media/platform/sunxi/sun6i-csi/Kconfig|   4 +-
 drivers/media/platform/xilinx/Kconfig |   4 +-
 drivers/media/spi/Kconfig |   4 +-
 drivers/media/test_drivers/vimc/Kconfig   |   4 +-
 drivers/staging/media/hantro/Kconfig  |   5 +-
 drivers/staging/media/imx/Kconfig |   5 +-
 drivers/staging/media/ipu3/Kconfig|   3 +-
 drivers/staging/media/omap4iss/Kconfig|   4 +-
 drivers/staging/media/rkisp1/Kconfig  |   4 +-
 drivers/staging/media/sunxi/cedrus/Kconfig|   5 +-
 24 files changed, 236 insertions(+), 105 deletions(-)

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index 125d596c13dd..4bc4cfea2f20 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -19,7 +19,7 @@ config VIDEO_IR_I2C
  In doubt, say Y.
 
 #
-# Encoder / Decoder module configuration
+# V4L2 I2C drivers that aren't related with Camera support
 #
 
 comment "I2C drivers hidden by 'Autoselect ancillary drivers'"
@@ -28,6 +28,10 @@ comment "I2C drivers hidden by 'Autoselect ancillary 
drivers'"
 menu "I2C Encoders, decoders, sensors and other helper chips"
visible if !MEDIA_HIDE_ANCILLARY_SUBDRV
 
+#
+# Encoder / Decoder module configuration
+#
+
 comment "Audio decoders, processors and mixers"
 
 config VIDEO_TVAUDIO
@@ -62,11 +66,13 @@ config VIDEO_TDA9840
 
 config VIDEO_TDA1997X
tristate "NXP TDA1997x HDMI receiver"
-   depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+   depends on VIDEO_V4L2 && I2C
depends on SND_SOC
select HDMI
select SND_PCM
select V4L2_FWNODE
+   select MEDIA_CONTROLLER
+   select VIDEO_V4L2_SUBDEV_API
help
  V4L2 subdevice driver for the NXP TDA1997x HDMI receivers.
 
@@ -204,7 +210,9 @@ comment "Video decoders"
 
 config VIDEO_ADV7180
tristate "Analog Devices ADV7180 decoder"
-   depends on GPIOLIB && VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+   depends on GPIOLIB && VIDEO_V4L2 && I2C
+   select MEDIA_CONTROLLER
+   select VIDEO_V4L2_SUBDEV_API
help
  Support for the Analog Devices ADV7180 video decoder.
 
@@ -223,8 +231,10 @@ config VIDEO_ADV7183
 
 config VIDEO_ADV748X
tristate "Analog Devices ADV748x decoder"
-   depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+   depends on VIDEO_V4L2 && I2C
depends on OF
+   select MEDIA_CONTROLLER
+   select VIDEO_V4L2_SUBDEV_API
select REGMAP_I2C
select V4L2_FWNODE
help
@@ -236,8 +246,10 @@ config VIDEO_ADV748X
 
 config VIDEO_ADV7604
tristate "Analog Devices ADV7604 decoder"
-   depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+   depends on VIDEO_V4L2 && I2C
depends on GPIOLIB || COMPILE_TEST
+   select MEDIA_CONTROLLER
+   select VIDEO_V4L2_SUBDEV_API
select REGMAP_I2C
select HDMI
select V4L2_FWNODE
@@ -260,7 +272,9 @@ config VIDEO_ADV7604_CEC
 
 config VIDEO_ADV7842
tristate "Analog Devices ADV7842 decoder"
-   depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+   depends on VIDEO_V4L2 && I2C
+   select MEDIA_CONTROLLER
+   select VIDEO_V4L2_SUBDEV_API
select HDMI
help
  Support for the Analog Devices ADV7842 video decoder.
@@ -347,7 +361,9 @@ config VIDEO_SAA711X
 
 config VIDEO_TC358743
tristate "Toshiba TC358743 decoder"
-   depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+   depends on VIDEO_V4L2 && I2C
+   select MEDIA_CONTROLLER
+   select 

[PATCH 0/4] media Kconfig reorg - part 2

2020-03-25 Thread Mauro Carvalho Chehab
That's the second part of media Kconfig changes. The entire series is
at:

https://git.linuxtv.org/mchehab/experimental.git/log/?h=media-kconfig

It addresses some issues I noticed when reviewing the series, and do
some changes on how things will be displayed.

It also simplify dependencencies on media-controller-dependent drivers,
by auto-selecting the needed deps.

It should be noticed that the media controller may also optionally
selected for several other drivers, so there is still a prompt to allow
manually enabling it, in the case it was not auto-selected.

PS.: While not needed anymore, because all dependent drivers auto
select, at least for now, I opted to keep the prompt for:

- VIDEO_V4L2_SUBDEV_API

  The rationale is that there are a few drivers that can optionally depend
  on it (like tvp5150). So, better to keep the dependency, in order to be
  able to test those drivers with and without the option.

- MEDIA_CONTROLLER_REQUEST_API

  The rationale is that there are some warnings at the Request API, and
  it would be good to keep it, at least while drivers are on staging.

Mauro Carvalho Chehab (4):
  media: dvb-core: Kconfig: default to use dynamic minors
  media: Kconfig files: use select for V4L2 subdevs and MC
  media: i2c/Kconfig: reorganize items there
  media: Kconfig: don't use visible for device type select

 drivers/media/Kconfig |  25 +-
 drivers/media/dvb-core/Kconfig|   1 +
 drivers/media/i2c/Kconfig | 406 +++---
 drivers/media/i2c/et8ek8/Kconfig  |   4 +-
 drivers/media/i2c/m5mols/Kconfig  |   5 +-
 drivers/media/i2c/smiapp/Kconfig  |   5 +-
 drivers/media/pci/cobalt/Kconfig  |   4 +-
 drivers/media/pci/intel/ipu3/Kconfig  |   4 +-
 drivers/media/pci/sta2x11/Kconfig |   6 +-
 drivers/media/platform/Kconfig|  28 +-
 drivers/media/platform/am437x/Kconfig |   4 +-
 drivers/media/platform/atmel/Kconfig  |   4 +-
 drivers/media/platform/cadence/Kconfig|   8 +-
 drivers/media/platform/exynos4-is/Kconfig |   5 +-
 drivers/media/platform/rcar-vin/Kconfig   |   8 +-
 .../media/platform/sunxi/sun4i-csi/Kconfig|   4 +-
 .../media/platform/sunxi/sun6i-csi/Kconfig|   4 +-
 drivers/media/platform/xilinx/Kconfig |   4 +-
 drivers/media/spi/Kconfig |   4 +-
 drivers/media/test_drivers/vimc/Kconfig   |   4 +-
 drivers/staging/media/hantro/Kconfig  |   5 +-
 drivers/staging/media/imx/Kconfig |   5 +-
 drivers/staging/media/ipu3/Kconfig|   3 +-
 drivers/staging/media/omap4iss/Kconfig|   4 +-
 drivers/staging/media/rkisp1/Kconfig  |   4 +-
 drivers/staging/media/sunxi/cedrus/Kconfig|   5 +-
 26 files changed, 349 insertions(+), 214 deletions(-)

-- 
2.25.1


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Outreachy kernel] [PATCH v2] Staging: rtl8188eu: hal: Add space around operators

2020-03-25 Thread Shreeya Patel
Add space around operators for improving the code
readability.
Reported by checkpatch.pl

git diff -w shows no difference.
diff of the .o files before and after the changes shows no difference.

Signed-off-by: Shreeya Patel 
---

shreeya@Shreeya-Patel:~staging$ git diff -w drivers/staging/rtl8188eu/hal/
shreeya@Shreeya-Patel:~staging$

shreeya@Shreeya-Patel:~staging/drivers/staging/rtl8188eu/hal$ find . -name 
"*_old.o" -exec sh -c 'old=$0; new=$(echo $old | sed s/_old.o/.o/);
diff $old $new' {} \;
shreeya@Shreeya-Patel:~staging/drivers/staging/rtl8188eu/hal$

Changes in v2:
  - Merge the patch series into a single patch


 drivers/staging/rtl8188eu/hal/hal_com.c   |  22 +--
 drivers/staging/rtl8188eu/hal/odm.c   |  48 +++---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c  |  54 +++
 drivers/staging/rtl8188eu/hal/phy.c   | 138 +-
 drivers/staging/rtl8188eu/hal/pwrseqcmd.c |   2 +-
 drivers/staging/rtl8188eu/hal/rf.c|  60 
 drivers/staging/rtl8188eu/hal/rf_cfg.c|   4 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c  |  42 +++---
 .../staging/rtl8188eu/hal/rtl8188e_hal_init.c |  44 +++---
 .../staging/rtl8188eu/hal/rtl8188e_rxdesc.c   |   2 +-
 .../staging/rtl8188eu/hal/rtl8188eu_xmit.c|  32 ++--
 11 files changed, 224 insertions(+), 224 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/hal_com.c 
b/drivers/staging/rtl8188eu/hal/hal_com.c
index 95f1b1431373..ebe19e076ff2 100644
--- a/drivers/staging/rtl8188eu/hal/hal_com.c
+++ b/drivers/staging/rtl8188eu/hal/hal_com.c
@@ -18,26 +18,26 @@ void dump_chip_info(struct HAL_VERSION  chip_vers)
uint cnt = 0;
char buf[128];
 
-   cnt += sprintf((buf+cnt), "Chip Version Info: CHIP_8188E_");
-   cnt += sprintf((buf+cnt), "%s_", chip_vers.ChipType == NORMAL_CHIP ?
+   cnt += sprintf((buf + cnt), "Chip Version Info: CHIP_8188E_");
+   cnt += sprintf((buf + cnt), "%s_", chip_vers.ChipType == NORMAL_CHIP ?
   "Normal_Chip" : "Test_Chip");
-   cnt += sprintf((buf+cnt), "%s_", chip_vers.VendorType == 
CHIP_VENDOR_TSMC ?
+   cnt += sprintf((buf + cnt), "%s_", chip_vers.VendorType == 
CHIP_VENDOR_TSMC ?
   "TSMC" : "UMC");
if (chip_vers.CUTVersion == A_CUT_VERSION)
-   cnt += sprintf((buf+cnt), "A_CUT_");
+   cnt += sprintf((buf + cnt), "A_CUT_");
else if (chip_vers.CUTVersion == B_CUT_VERSION)
-   cnt += sprintf((buf+cnt), "B_CUT_");
+   cnt += sprintf((buf + cnt), "B_CUT_");
else if (chip_vers.CUTVersion == C_CUT_VERSION)
-   cnt += sprintf((buf+cnt), "C_CUT_");
+   cnt += sprintf((buf + cnt), "C_CUT_");
else if (chip_vers.CUTVersion == D_CUT_VERSION)
-   cnt += sprintf((buf+cnt), "D_CUT_");
+   cnt += sprintf((buf + cnt), "D_CUT_");
else if (chip_vers.CUTVersion == E_CUT_VERSION)
-   cnt += sprintf((buf+cnt), "E_CUT_");
+   cnt += sprintf((buf + cnt), "E_CUT_");
else
-   cnt += sprintf((buf+cnt), "UNKNOWN_CUT(%d)_",
+   cnt += sprintf((buf + cnt), "UNKNOWN_CUT(%d)_",
   chip_vers.CUTVersion);
-   cnt += sprintf((buf+cnt), "1T1R_");
-   cnt += sprintf((buf+cnt), "RomVer(0)\n");
+   cnt += sprintf((buf + cnt), "1T1R_");
+   cnt += sprintf((buf + cnt), "RomVer(0)\n");
 
pr_info("%s", buf);
 }
diff --git a/drivers/staging/rtl8188eu/hal/odm.c 
b/drivers/staging/rtl8188eu/hal/odm.c
index 7489491f5aaa..a6eb9798b6f8 100644
--- a/drivers/staging/rtl8188eu/hal/odm.c
+++ b/drivers/staging/rtl8188eu/hal/odm.c
@@ -342,7 +342,7 @@ void odm_DIG(struct odm_dm_struct *pDM_Odm)
u8 CurrentIGI = pDM_DigTable->CurIGValue;
 
ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG()==>\n"));
-   if ((!(pDM_Odm->SupportAbility_BB_DIG)) || 
(!(pDM_Odm->SupportAbility_BB_FA_CNT))) {
+   if ((!(pDM_Odm->SupportAbility & ODM_BB_DIG)) || 
(!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT))) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD,
 ("odm_DIG() Return: SupportAbility ODM_BB_DIG or 
ODM_BB_FA_CNT is disabled\n"));
return;
@@ -419,7 +419,7 @@ void odm_DIG(struct odm_dm_struct *pDM_Odm)
}
 
if (pDM_DigTable->LargeFAHit >= 3) {
-   if ((pDM_DigTable->ForbiddenIGI+1) > 
pDM_DigTable->rx_gain_range_max)
+   if ((pDM_DigTable->ForbiddenIGI + 1) > 
pDM_DigTable->rx_gain_range_max)
pDM_DigTable->rx_gain_range_min = 
pDM_DigTable->rx_gain_range_max;
else
pDM_DigTable->rx_gain_range_min = 
(pDM_DigTable->ForbiddenIGI + 1);
@@ -432,7 +432,7 @@ void odm_DIG(struct odm_dm_struct *pDM_Odm)
pDM_DigTable->Recover_cnt--;
} else {
 

Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter

2020-03-25 Thread Bastien Nocera
On Tue, 2020-03-24 at 20:35 +0300, Dan Carpenter wrote:
> On Tue, Mar 24, 2020 at 04:21:47PM +0100, Bastien Nocera wrote:
> > On Tue, 2020-03-24 at 16:20 +0100, Greg Kroah-Hartman wrote:
> > > On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote:
> > > > Make it possible to disable the LED, as it can be pretty
> > > > annoying
> > > > depending on where it's located.
> > > > 
> > > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the
> > > > out-of-tree version.
> > > > 
> > > > Signed-off-by: Bastien Nocera 
> > > > ---
> > > >  drivers/staging/rtl8188eu/core/rtw_led.c  | 6 ++
> > > >  drivers/staging/rtl8188eu/include/drv_types.h | 2 ++
> > > >  drivers/staging/rtl8188eu/os_dep/os_intfs.c   | 5 +
> > > >  3 files changed, 13 insertions(+)
> > > 
> > > Why was this resent?  Didn't I just reject this?
> > 
> > It wasn't resent, it's the same mail you already answered.
> 
> It says "resend" in the subject.

This isn't what we were talking about though ;)

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723bs: Remove multiple assignments

2020-03-25 Thread Simran Singhal
Remove multiple assignments by factorizing them.
Problem found using checkpatch.pl:-
CHECK: multiple assignments should be avoided

Signed-off-by: Simran Singhal 
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c 
b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index 61a9bf61b976..744b40dd4cf0 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -194,7 +194,9 @@ int rtw_init_cmd_priv(structcmd_priv *pcmdpriv)
 
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf  +  4 - 
((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
 
-   pcmdpriv->cmd_issued_cnt = pcmdpriv->cmd_done_cnt = pcmdpriv->rsp_cnt = 
0;
+   pcmdpriv->cmd_issued_cnt = 0;
+   pcmdpriv->cmd_done_cnt = 0;
+   pcmdpriv->rsp_cnt = 0;
 
mutex_init(>sctx_mutex);
 exit:
@@ -2138,7 +2140,8 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter 
*padapter,  struct cmd_obj *
goto exit;
}
 
-   psta->aid = psta->mac_id = passocsta_rsp->cam_id;
+   psta->aid = passocsta_rsp->cam_id;
+   psta->mac_id = passocsta_rsp->cam_id;
 
spin_lock_bh(>lock);
 
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723bs: Remove unnecessary braces for single statements

2020-03-25 Thread Simran Singhal
Clean up unnecessary braces around single statement blocks.
Issues reported by checkpatch.pl as:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Simran Singhal 
---
 drivers/staging/rtl8723bs/core/rtw_efuse.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_efuse.c 
b/drivers/staging/rtl8723bs/core/rtw_efuse.c
index bdb6ff8aab7d..de7d15fdc936 100644
--- a/drivers/staging/rtl8723bs/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723bs/core/rtw_efuse.c
@@ -43,9 +43,8 @@ Efuse_Read1ByteFromFakeContent(
u16 Offset,
u8 *Value)
 {
-   if (Offset >= EFUSE_MAX_HW_SIZE) {
+   if (Offset >= EFUSE_MAX_HW_SIZE)
return false;
-   }
/* DbgPrint("Read fake content, offset = %d\n", Offset); */
if (fakeEfuseBank == 0)
*Value = fakeEfuseContent[Offset];
@@ -65,14 +64,12 @@ Efuse_Write1ByteToFakeContent(
u16 Offset,
u8 Value)
 {
-   if (Offset >= EFUSE_MAX_HW_SIZE) {
+   if (Offset >= EFUSE_MAX_HW_SIZE)
return false;
-   }
if (fakeEfuseBank == 0)
fakeEfuseContent[Offset] = Value;
-   else {
+   else
fakeBTEfuseContent[fakeEfuseBank-1][Offset] = Value;
-   }
return true;
 }
 
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Funds

2020-03-25 Thread Ms. Reem E Alhashimy
Hello,
 
My name is Ms. Reem Al-Hashimi. I found your contact from an email database 
from 
your country while i was looking for someone to handle a huge financial 
transaction
for me in confidence. Please reply for more details if you are interested.
 
Regards,
Ms. Reem Al-Hashimy
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: KASAN: slab-out-of-bounds Read in hfa384x_usbin_callback

2020-03-25 Thread Hillf Danton


On Wed, 25 Mar 2020 01:58:03 -0700
> syzbot has tested the proposed patch but the reproducer still triggered crash:
> KASAN: use-after-free Read in hfa384x_usbin_callback
> 
> ==
> BUG: KASAN: use-after-free in memcpy include/linux/string.h:381 [inline]
> BUG: KASAN: use-after-free in skb_put_data include/linux/skbuff.h:2284 
> [inline]
> BUG: KASAN: use-after-free in hfa384x_int_rxmonitor 
> drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
> BUG: KASAN: use-after-free in hfa384x_usbin_rx 
> drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
> BUG: KASAN: use-after-free in hfa384x_usbin_callback+0x1993/0x2360 
> drivers/staging/wlan-ng/hfa384x_usb.c:3026
> Read of size 19671 at addr 8881cda7b33c by task kworker/1:2/95
> 
> CPU: 1 PID: 95 Comm: kworker/1:2 Not tainted 5.6.0-rc5-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS 
> Google 01/01/2011
> Workqueue: usb_hub_wq hub_event
> Call Trace:
>  
>  __dump_stack lib/dump_stack.c:77 [inline]
>  dump_stack+0xef/0x16e lib/dump_stack.c:118
>  print_address_description.constprop.0.cold+0xd3/0x314 mm/kasan/report.c:374
>  __kasan_report.cold+0x37/0x77 mm/kasan/report.c:506
>  kasan_report+0xe/0x20 mm/kasan/common.c:641
>  check_memory_region_inline mm/kasan/generic.c:185 [inline]
>  check_memory_region+0x152/0x1c0 mm/kasan/generic.c:192
>  memcpy+0x20/0x50 mm/kasan/common.c:127
>  memcpy include/linux/string.h:381 [inline]
>  skb_put_data include/linux/skbuff.h:2284 [inline]
>  hfa384x_int_rxmonitor drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
>  hfa384x_usbin_rx drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
>  hfa384x_usbin_callback+0x1993/0x2360 
> drivers/staging/wlan-ng/hfa384x_usb.c:3026
>  __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
>  usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
>  dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966
>  call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404
>  expire_timers kernel/time/timer.c:1449 [inline]
>  __run_timers kernel/time/timer.c:1773 [inline]
>  __run_timers kernel/time/timer.c:1740 [inline]
>  run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786
>  __do_softirq+0x21e/0x950 kernel/softirq.c:292
>  invoke_softirq kernel/softirq.c:373 [inline]
>  irq_exit+0x178/0x1a0 kernel/softirq.c:413
>  exiting_irq arch/x86/include/asm/apic.h:546 [inline]
>  smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146
>  apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
>  
> RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline]
> RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 
> [inline]
> RIP: 0010:_raw_spin_unlock_irqrestore+0x3b/0x40 kernel/locking/spinlock.c:191
> Code: e8 2a e8 96 fb 48 89 ef e8 f2 c9 97 fb f6 c7 02 75 11 53 9d e8 16 50 b5 
> fb 65 ff 0d f7 bd 72 7a 5b 5d c3 e8 07 4e b5 fb 53 9d  ed 0f 1f 00 55 48 
> 89 fd 65 ff 05 dd bd 72 7a 45 31 c9 41 b8 01
> RSP: 0018:8881d56b6f40 EFLAGS: 0293 ORIG_RAX: ff13
> RAX: 0007 RBX: 0293 RCX: 0006
> RDX:  RSI: 8881d56a88f0 RDI: 8881d56a884c
> RBP: 8881c0c64b80 R08: 8881d56a8000 R09: fbfff1266e8f
> R10: fbfff1266e8e R11: 89337477 R12: 
> R13: 8881c0c64bb8 R14: 8881c0c64b80 R15: 8881c0c64bb8
>  hfa384x_usbctlx_submit+0x1cb/0x260 drivers/staging/wlan-ng/hfa384x_usb.c:3834
>  hfa384x_docmd drivers/staging/wlan-ng/hfa384x_usb.c:1233 [inline]
>  hfa384x_cmd_initialize+0x290/0x4f0 drivers/staging/wlan-ng/hfa384x_usb.c:846
>  hfa384x_drvr_start+0x1f1/0x480 drivers/staging/wlan-ng/hfa384x_usb.c:2380
>  prism2sta_ifstate+0x24e/0x510 drivers/staging/wlan-ng/prism2sta.c:471
>  prism2sta_probe_usb.cold+0x1c8/0x49e drivers/staging/wlan-ng/prism2usb.c:112
>  usb_probe_interface+0x310/0x800 drivers/usb/core/driver.c:374
>  really_probe+0x290/0xac0 drivers/base/dd.c:551
>  driver_probe_device+0x223/0x350 drivers/base/dd.c:724
>  __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:831
>  bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
>  __device_attach+0x217/0x390 drivers/base/dd.c:897
>  bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
>  device_add+0x1459/0x1bf0 drivers/base/core.c:2500
>  usb_set_configuration+0xe47/0x17d0 drivers/usb/core/message.c:2023
>  usb_generic_driver_probe+0x9d/0xe0 drivers/usb/core/generic.c:241
>  usb_probe_device+0xd9/0x230 drivers/usb/core/driver.c:272
>  really_probe+0x290/0xac0 drivers/base/dd.c:551
>  driver_probe_device+0x223/0x350 drivers/base/dd.c:724
>  __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:831
>  bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
>  __device_attach+0x217/0x390 drivers/base/dd.c:897
>  bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
>  device_add+0x1459/0x1bf0 drivers/base/core.c:2500
>  usb_new_device.cold+0x540/0xcd0 

Re: [Outreachy kernel] [PATCH v2] staging: kpc2000: Removing a blank line

2020-03-25 Thread Julia Lawall
On Wed, 25 Mar 2020, Simran Singhal wrote:

> This patch fixes the checkpatch warning by removing a blank
> line.
> CHECK: Please don't use multiple blank lines

The subject line and the log message should be written in the imperative.
So that would be Remove, rather than Removing for the subject line.

The log message should first say what you did to fix the problem and why.
How the problem was found can come afterwards.  So you should not start
with "This patch fixes the checkpatch warning by".  "This patch" is not
useful, because it is obvious that it is a patch, based on the subject
line.  "fixes" does not given any information about what is done or why.
"the checkpatch warning" is useful, but it's not what one wants to see
first.

julia

>
> Signed-off-by: Simran Singhal 
> ---
> Changes in v2:
>   - Make the subject and commit message correct by mentioning that
> this patch specifically removes a blank line.
>
>  drivers/staging/kpc2000/kpc2000/pcie.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/kpc2000/kpc2000/pcie.h 
> b/drivers/staging/kpc2000/kpc2000/pcie.h
> index cb815c30faa4..f1fc91b4c704 100644
> --- a/drivers/staging/kpc2000/kpc2000/pcie.h
> +++ b/drivers/staging/kpc2000/kpc2000/pcie.h
> @@ -6,7 +6,6 @@
>  #include "../kpc.h"
>  #include "dma_common_defs.h"
>
> -
>  /*  System Register Map (BAR 1, Start Addr 0)
>   *
>   *  BAR Size:
> --
> 2.17.1
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/20200325095407.GA3788%40simran-Inspiron-5558.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: kpc2000: Removing a blank line

2020-03-25 Thread Simran Singhal
This patch fixes the checkpatch warning by removing a blank
line.
CHECK: Please don't use multiple blank lines

Signed-off-by: Simran Singhal 
---
Changes in v2:
  - Make the subject and commit message correct by mentioning that
this patch specifically removes a blank line.

 drivers/staging/kpc2000/kpc2000/pcie.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/kpc2000/kpc2000/pcie.h 
b/drivers/staging/kpc2000/kpc2000/pcie.h
index cb815c30faa4..f1fc91b4c704 100644
--- a/drivers/staging/kpc2000/kpc2000/pcie.h
+++ b/drivers/staging/kpc2000/kpc2000/pcie.h
@@ -6,7 +6,6 @@
 #include "../kpc.h"
 #include "dma_common_defs.h"
 
-
 /*  System Register Map (BAR 1, Start Addr 0)
  *
  *  BAR Size:
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


BUSINESS PROPOSAL !!!

2020-03-25 Thread Abdul Kareem
Dearest Friend

I am Mr Abdul Kareem working with Emirate NBD Bank Dubai,United Arab Emirate as 
Finance Manager.
I have a very profitable Business that relate to you and will benefit both of 
us after completion.
Kindly get back to me for more details.
Awaiting your response.
Regards
Abdul Kareem
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size

2020-03-25 Thread Quentin Deslandes
On 03/24/20 16:18:30, Dan Carpenter wrote:
> That's a bit over engineering something which is pretty trivial.
> Normally, we would just make the size a define instead of a magic number
> 14.

My bad, I meant "define", not "macro".

> If people change the size in the future (unlikely) and it causes a bug
> then they kind of deserve it because they need to ensure all the new
> stuff is initialized, right?  If they change it and it results in a
> buffer overflow then static checkers would complain.  If they changed it
> and it resulted in uninitialized data being used then it would be zero
> so that's okay.

I wasn't sure where I should stand on this, that's clearer now.

Thanks,
Quentin
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: KASAN: slab-out-of-bounds Read in hfa384x_usbin_callback

2020-03-25 Thread syzbot
Hello,

syzbot has tested the proposed patch but the reproducer still triggered crash:
KASAN: use-after-free Read in hfa384x_usbin_callback

==
BUG: KASAN: use-after-free in memcpy include/linux/string.h:381 [inline]
BUG: KASAN: use-after-free in skb_put_data include/linux/skbuff.h:2284 [inline]
BUG: KASAN: use-after-free in hfa384x_int_rxmonitor 
drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
BUG: KASAN: use-after-free in hfa384x_usbin_rx 
drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
BUG: KASAN: use-after-free in hfa384x_usbin_callback+0x1993/0x2360 
drivers/staging/wlan-ng/hfa384x_usb.c:3026
Read of size 19671 at addr 8881cda7b33c by task kworker/1:2/95

CPU: 1 PID: 95 Comm: kworker/1:2 Not tainted 5.6.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 
01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
 
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0xef/0x16e lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xd3/0x314 mm/kasan/report.c:374
 __kasan_report.cold+0x37/0x77 mm/kasan/report.c:506
 kasan_report+0xe/0x20 mm/kasan/common.c:641
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x152/0x1c0 mm/kasan/generic.c:192
 memcpy+0x20/0x50 mm/kasan/common.c:127
 memcpy include/linux/string.h:381 [inline]
 skb_put_data include/linux/skbuff.h:2284 [inline]
 hfa384x_int_rxmonitor drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
 hfa384x_usbin_rx drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
 hfa384x_usbin_callback+0x1993/0x2360 drivers/staging/wlan-ng/hfa384x_usb.c:3026
 __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
 usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
 dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966
 call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404
 expire_timers kernel/time/timer.c:1449 [inline]
 __run_timers kernel/time/timer.c:1773 [inline]
 __run_timers kernel/time/timer.c:1740 [inline]
 run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786
 __do_softirq+0x21e/0x950 kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0x178/0x1a0 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:546 [inline]
 smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
 
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline]
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 
[inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x3b/0x40 kernel/locking/spinlock.c:191
Code: e8 2a e8 96 fb 48 89 ef e8 f2 c9 97 fb f6 c7 02 75 11 53 9d e8 16 50 b5 
fb 65 ff 0d f7 bd 72 7a 5b 5d c3 e8 07 4e b5 fb 53 9d  ed 0f 1f 00 55 48 89 
fd 65 ff 05 dd bd 72 7a 45 31 c9 41 b8 01
RSP: 0018:8881d56b6f40 EFLAGS: 0293 ORIG_RAX: ff13
RAX: 0007 RBX: 0293 RCX: 0006
RDX:  RSI: 8881d56a88f0 RDI: 8881d56a884c
RBP: 8881c0c64b80 R08: 8881d56a8000 R09: fbfff1266e8f
R10: fbfff1266e8e R11: 89337477 R12: 
R13: 8881c0c64bb8 R14: 8881c0c64b80 R15: 8881c0c64bb8
 hfa384x_usbctlx_submit+0x1cb/0x260 drivers/staging/wlan-ng/hfa384x_usb.c:3834
 hfa384x_docmd drivers/staging/wlan-ng/hfa384x_usb.c:1233 [inline]
 hfa384x_cmd_initialize+0x290/0x4f0 drivers/staging/wlan-ng/hfa384x_usb.c:846
 hfa384x_drvr_start+0x1f1/0x480 drivers/staging/wlan-ng/hfa384x_usb.c:2380
 prism2sta_ifstate+0x24e/0x510 drivers/staging/wlan-ng/prism2sta.c:471
 prism2sta_probe_usb.cold+0x1c8/0x49e drivers/staging/wlan-ng/prism2usb.c:112
 usb_probe_interface+0x310/0x800 drivers/usb/core/driver.c:374
 really_probe+0x290/0xac0 drivers/base/dd.c:551
 driver_probe_device+0x223/0x350 drivers/base/dd.c:724
 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:831
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
 __device_attach+0x217/0x390 drivers/base/dd.c:897
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0x1459/0x1bf0 drivers/base/core.c:2500
 usb_set_configuration+0xe47/0x17d0 drivers/usb/core/message.c:2023
 usb_generic_driver_probe+0x9d/0xe0 drivers/usb/core/generic.c:241
 usb_probe_device+0xd9/0x230 drivers/usb/core/driver.c:272
 really_probe+0x290/0xac0 drivers/base/dd.c:551
 driver_probe_device+0x223/0x350 drivers/base/dd.c:724
 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:831
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:431
 __device_attach+0x217/0x390 drivers/base/dd.c:897
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0x1459/0x1bf0 drivers/base/core.c:2500
 usb_new_device.cold+0x540/0xcd0 drivers/usb/core/hub.c:2548
 hub_port_connect drivers/usb/core/hub.c:5195 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5335 [inline]
 port_event drivers/usb/core/hub.c:5481 [inline]
 hub_event+0x21cb/0x4300 

Re: KASAN: slab-out-of-bounds Read in hfa384x_usbin_callback

2020-03-25 Thread Qiujun Huang
#syz test: https://github.com/google/kasan.git e17994d1

On Sat, Mar 21, 2020 at 3:28 AM syzbot
 wrote:
>
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit:e17994d1 usb: core: kcov: collect coverage from usb comple..
> git tree:   https://github.com/google/kasan.git usb-fuzzer
> console output: https://syzkaller.appspot.com/x/log.txt?x=11d74573e0
> kernel config:  https://syzkaller.appspot.com/x/.config?x=5d64370c438bc60
> dashboard link: https://syzkaller.appspot.com/bug?extid=7d42d68643a35f71ac8a
> compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=15fa561de0
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15d74573e0
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+7d42d68643a35f71a...@syzkaller.appspotmail.com
>
> ==
> BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:381 [inline]
> BUG: KASAN: slab-out-of-bounds in skb_put_data include/linux/skbuff.h:2284 
> [inline]
> BUG: KASAN: slab-out-of-bounds in hfa384x_int_rxmonitor 
> drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
> BUG: KASAN: slab-out-of-bounds in hfa384x_usbin_rx 
> drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
> BUG: KASAN: slab-out-of-bounds in hfa384x_usbin_callback+0x1993/0x2360 
> drivers/staging/wlan-ng/hfa384x_usb.c:3026
> Read of size 19671 at addr 8881d226413c by task swapper/0/0
>
> CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc5-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS 
> Google 01/01/2011
> Call Trace:
>  
>  __dump_stack lib/dump_stack.c:77 [inline]
>  dump_stack+0xef/0x16e lib/dump_stack.c:118
>  print_address_description.constprop.0.cold+0xd3/0x314 mm/kasan/report.c:374
>  __kasan_report.cold+0x37/0x77 mm/kasan/report.c:506
>  kasan_report+0xe/0x20 mm/kasan/common.c:641
>  check_memory_region_inline mm/kasan/generic.c:185 [inline]
>  check_memory_region+0x152/0x1c0 mm/kasan/generic.c:192
>  memcpy+0x20/0x50 mm/kasan/common.c:127
>  memcpy include/linux/string.h:381 [inline]
>  skb_put_data include/linux/skbuff.h:2284 [inline]
>  hfa384x_int_rxmonitor drivers/staging/wlan-ng/hfa384x_usb.c:3412 [inline]
>  hfa384x_usbin_rx drivers/staging/wlan-ng/hfa384x_usb.c:3312 [inline]
>  hfa384x_usbin_callback+0x1993/0x2360 
> drivers/staging/wlan-ng/hfa384x_usb.c:3026
>  __usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
>  usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
>  dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966
>  call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404
>  expire_timers kernel/time/timer.c:1449 [inline]
>  __run_timers kernel/time/timer.c:1773 [inline]
>  __run_timers kernel/time/timer.c:1740 [inline]
>  run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786
>  __do_softirq+0x21e/0x950 kernel/softirq.c:292
>  invoke_softirq kernel/softirq.c:373 [inline]
>  irq_exit+0x178/0x1a0 kernel/softirq.c:413
>  exiting_irq arch/x86/include/asm/apic.h:546 [inline]
>  smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146
>  apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
>  
> RIP: 0010:default_idle+0x28/0x300 arch/x86/kernel/process.c:696
> Code: cc cc 41 56 41 55 65 44 8b 2d 44 77 72 7a 41 54 55 53 0f 1f 44 00 00 e8 
> b6 62 b5 fb e9 07 00 00 00 0f 00 2d ea 0c 53 00 fb f4 <65> 44 8b 2d 20 77 72 
> 7a 0f 1f 44 00 00 5b 5d 41 5c 41 5d 41 5e c3
> RSP: 0018:87007d80 EFLAGS: 0246 ORIG_RAX: ff13
> RAX: 0007 RBX: 8702cc40 RCX: 
> RDX:  RSI: 0006 RDI: 8702d48c
> RBP: fbfff0e05988 R08: 8702cc40 R09: 
> R10:  R11:  R12: 
> R13:  R14: 87e607c0 R15: 
>  cpuidle_idle_call kernel/sched/idle.c:154 [inline]
>  do_idle+0x3e0/0x500 kernel/sched/idle.c:269
>  cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:361
>  start_kernel+0xe16/0xe5a init/main.c:998
>  secondary_startup_64+0xb6/0xc0 arch/x86/kernel/head_64.S:242
>
> The buggy address belongs to the page:
> page:ea0007489800 refcount:32744 mapcount:0 mapping: 
> index:0x0 compound_mapcount: 0
> flags: 0x201(head)
> raw: 0201 dead0100 dead0122 
> raw:   7fe8 
> page dumped because: kasan: bad access detected
>
> Memory state around the buggy address:
>  8881d2268000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>  8881d2268080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> >8881d2268100: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
>^
>  8881d2268180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>  8881d2268200: 00 00 00 00 

[PATCH] staging: wlan-ng: fix ODEBUG bug in prism2sta_disconnect_usb

2020-03-25 Thread Qiujun Huang
We should cancel hw->usb_work before kfree(hw).

Reported-by: syzbot+6d2e7f6fa90e27be9...@syzkaller.appspotmail.com
Signed-off-by: Qiujun Huang 
---
 drivers/staging/wlan-ng/prism2usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wlan-ng/prism2usb.c 
b/drivers/staging/wlan-ng/prism2usb.c
index 352556f..4689b21 100644
--- a/drivers/staging/wlan-ng/prism2usb.c
+++ b/drivers/staging/wlan-ng/prism2usb.c
@@ -180,6 +180,7 @@ static void prism2sta_disconnect_usb(struct usb_interface 
*interface)
 
cancel_work_sync(>link_bh);
cancel_work_sync(>commsqual_bh);
+   cancel_work_sync(>usb_work);
 
/* Now we complete any outstanding commands
 * and tell everyone who is waiting for their
-- 
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel