off-by: Fuqian Huang
---
drivers/tty/rocket.c | 154 +--
drivers/tty/rocket.h | 10
2 files changed, 1 insertion(+), 163 deletions(-)
diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
index b121d8f8f3d7..e3b4e8bc2d7a 100644
--- a/driv
If the cmd is RCPK_GET_STRUCT, copy_to_user will copy
info to user space. As info->port.ops is the address of
a constant object rocket_port_ops (assigned in init_r_port),
a kernel address leakage happens.
Remove the RCPK_GET_STRUCT ioctl.
Signed-off-by: Fuqian Huang
---
drivers/tty/rocke
This patch depends on patch 01.
The rp_ioctl is deprecated.
Add dev_warn_ratelimited to warn the use of rp_ioctl.
Signed-off-by: Fuqian Huang
---
drivers/tty/rocket.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
index b6543e28bd8b
Pointers should be printed with %p or %px rather than
cast to long type and printed with %lx.
Drop the address printing.
Signed-off-by: Fuqian Huang
---
sound/isa/gus/gus_mem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c
; however, it is not an easy fix, so for now just ensure
that the error code and CR2 are zero.
Signed-off-by: Fuqian Huang
---
arch/x86/kvm/x86.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 290c3c3efb87..7f442d710858 100644
--- a/arch/x86/kvm/x86.c
Vitaly Kuznetsov 於 2019年9月12日週四 下午4:51寫道:
>
> Fuqian Huang writes:
>
> > Emulation of VMPTRST can incorrectly inject a page fault
> > when passed an operand that points to an MMIO address.
> > The page fault will use uninitialized kernel stack memory
> > as th
Vitaly Kuznetsov 於 2019年9月12日週四 下午6:53寫道:
>
> Fuqian Huang writes:
>
> > Vitaly Kuznetsov 於 2019年9月12日週四 下午4:51寫道:
> >>
> >> Fuqian Huang writes:
> >>
> >> > Emulation of VMPTRST can incorrectly inject a page fault
> >> > when
Avoid print the address of l440gx_map.virt every time l440gx init.
Signed-off-by: Fuqian Huang
---
drivers/mtd/maps/l440gx.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mtd/maps/l440gx.c b/drivers/mtd/maps/l440gx.c
index 876f12f40018..e7e40bca82d1 100644
--- a/drivers/mtd/maps
xen_auto_xlat_grant_frames.vaddr is definitely NULL in this case.
So the address printing is unnecessary.
Signed-off-by: Fuqian Huang
---
drivers/xen/grant-table.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index
.
This will leak uninitialized stack content to userland.
Fix this by zeroing the uninitialized field.
Signed-off-by: Fuqian Huang
---
arch/m68k/q40/config.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index e63eb5f06999..f31890078197 100644
Avoid printing the address of l440gx_map.virt every time l440gx init.
Signed-off-by: Fuqian Huang
---
drivers/mtd/maps/l440gx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/maps/l440gx.c b/drivers/mtd/maps/l440gx.c
index 876f12f40018..ebe37edc8e88 100644
--- a
Avoid printing the address of l440gx_map.virt every time l440gx init.
Signed-off-by: Fuqian Huang
---
Changes in v3:
-- use pr_debug instead of printk(KERN_DEBUG)
drivers/mtd/maps/l440gx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/maps/l440gx.c b/drivers
Hi, recently I came across some code and it seems to be able to leak
kernel address?
Is the following code cause info leak in the Linux kernel?
The callback function address is printed to debugfs.
The local user could know the kernel object address, and is able to
bypass kASLR.
linux-4.14.90
driver
Hi, recently I found that there is a kernel address leaks to user
space via copy_to_user in
drivers/tty/rocket.c:1287 (linux-5.0.5)
static int rp_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned
long arg) {
...
case RCKP_GET_STRUCT:
if (copy_to_user(argp, info, sizeof(struct r_por
sked_info);
>1306 if (copy_to_user(argp, masked_info, sizeof (struct r_port)))
1307 ret = -EFAULT;
Greg KH 於 2019年3月30日週六 下午3:14寫道:
>
> On Sat, Mar 30, 2019 at 03:05:11PM +0800, Fuqian Huang wrote:
> > Hi, recently I found that there is a kernel address l
oid kernel address leakage.
Signed-off-by: Fuqian Huang
---
drivers/tty/rocket.c | 31 +--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
index b121d8f8f3d7..a7bcf44b61bd 100644
--- a/drivers/tty/rocket.c
++
ore copy_to_user.
Another reason is that I have checked all uses of copy_to_user and
copy_from_user in this file, they do not use any of these pointer
fields. So these pointer fields can be set NULL safely.
Signed-off-by: Fuqian Huang
---
drivers/tty/rocket.c |
The pointers should be printed with %p or %px rather than
cast to long or unsigned long type and printed with %x.
Change %x to %p to print pointers.
Signed-off-by: Fuqian Huang
---
drivers/atm/iphase.c | 4 ++--
drivers/misc/genwqe/card_debugfs.c | 4 ++--
drivers/net/hippi
The pointer should be printed with %p or %px rather than
cast to long long type and printed with %016llx.
Change %x to %p to print the pointer.
Signed-off-by: Fuqian Huang
---
drivers/misc/genwqe/card_debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc
Pointers should be printed with %p or %px rather than
cast to unsigned long type and printed with %lx.
Change %lx to %p to print the pointers.
Signed-off-by: Fuqian Huang
---
kernel/cgroup/debug.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/cgroup/debug.c
Pointers should be printed with %p or %px rather than
cast to long type and printed with %lx.
Change %lx to %p to print the pointer.
Signed-off-by: Fuqian Huang
---
sound/isa/gus/gus_mem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/isa/gus/gus_mem.c b/sound/isa
Pointers should be printed with %p or %px rather than
cast to unsigned long type and printed with %lx.
Change %lx to %pK to print the pointers.
Signed-off-by: Fuqian Huang
---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8
1 file changed, 4 insertions(+), 4
Pointers should be printed with %p or %px rather than
cast to unsigned long type and printed with %lx.
Change %lx to %pK to print the pointers.
Signed-off-by: Fuqian Huang
---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8
1 file changed, 4 insertions(+), 4
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/at
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drive
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
driver
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Acked-by: Neil Horman
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the comm
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/
pci_alloc_consistent calls dma_alloc_coherent directly.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rathe
pci_alloc_consitent calls dma_alloc_coherent directly.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rathe
not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/net/ethernet/atheros/atlx/atl1.c | 2 --
drivers/net/ethernet/atheros/atlx/atl2.c | 1 -
drivers/net/ethernet/broadcom/b
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
dri
vzalloc has already zeroed the memory during the allocation.
So memset is unneeded.
Signed-off-by: Fuqian Huang
---
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index
pci_alloc_consistent calls dma_alloc_coherent directly.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rathe
pci_alloc_consistent calls dma_alloc_coherent directly.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rathe
pci_alloc_consistent calls dma_alloc_coherent directly.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rathe
kcalloc already zeros the memory during allocation.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So the memset after these functions is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
-
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/n
Sinan Kaya 於 2019年7月15日週一 下午12:17寫道:
>
> On 7/14/2019 11:17 PM, Fuqian Huang wrote:
> > In commit 518a2f1925c3
> > ("dma-mapping: zero memory returned from dma_alloc_*"),
> > dma_alloc_coherent has already zeroed the memory.
> > So memset is not needed.
&g
Sylwester Nawrocki 於 2019年7月15日週一 下午5:00寫道:
>
> On 7/15/19 05:18, Fuqian Huang wrote:
> > In commit 518a2f1925c3
> > ("dma-mapping: zero memory returned from dma_alloc_*"),
> > dma_alloc_coherent has already zeroed the memory.
> > So memset is not needed
As mutex_lock might sleep.
Function pcap_adc_irq is an interrupt handler.
The use of mutex_lock in pcap_adc_irq may cause sleep
in IRQ context.
Replace mutex_lock with spin_lock to avoid this.
Signed-off-by: Fuqian Huang
---
drivers/mfd/ezx-pcap.c | 53
As spin_unlock_irq will enable interrupts.
Function tsi108_stat_carry is called from interrupt handler tsi108_irq.
Interrupts are enabled in interrupt handler.
Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
in IRQ context to avoid this.
Signed-off-by: Fuqian Huang
intr_handler
<- lpfc_sli_intr_handler
and lpfc_sli_intr_handler is an interrupt handler.
Interrupts are enabled in interrupt handler.
Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
in IRQ context to avoid this.
Signed-off-by: Fuqian Huang
---
drivers/scsi/lpfc/lpfc_hbadisc.c | 5 +++--
In function dmac_alloc_resources(), pl330->mcode_cpu is allocated using
dma_alloc_attrs() but freed with dma_free_coherent().
Use the correct dma_free_attrs() function to free pl330->mcode_cpu.
Signed-off-by: Fuqian Huang
---
drivers/dma/pl330.c | 9 +
1 file changed, 5 insertions
In the implementation of kmalloc.
when the allocated size is larger than KMALLOC_MAX_CACHE_SIZE,
it will call kmalloc_large to allocate the memory.
kmalloc_large ->
kmalloc_order_trace->kmalloc_order->alloc_pages->alloc_pages_current->alloc_pages_nodemask->get_page_from_freelist->node_reclaim->__no
i2c_pxa_handler -> i2c_pxa_irq_txempty ->
i2c_pxa_reset -> i2c_pxa_set_slave -> i2c_pxa_wait_slave
As i2c_pxa_handler is an interrupt handler, it will finally
calls i2c_pxa_wait_slave which calls msleep.
Add in_interrupt check before msleep to avoid sleep
in IRQ context.
Signed-of
c_system_die may be called in atomic context.
So the kmalloc in xpc_send_activate_IRQ_uv may be in atomic context.
Use GFP_ATOMIC instead of GFP_KERNEL in kmalloc.
Signed-off-by: Fuqian Huang
---
drivers/misc/sgi-xp/xpc_uv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/driv
Joe Perches 於 2019年7月31日週三 下午2:06寫道:
>
> On Wed, 2019-07-31 at 10:45 +0800, Fuqian Huang wrote:
> > In drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c,
> > amdgpu_ih_process calls DRM_DEBUG which calls drm_dbg and
> > finally calls printk.
> > As amdgpu_ih_process is ca
rrupts are enabled in interrupt handler.
Use spin_lock_irqsave instead of spin_lock_irq to avoid this.
Signed-off-by: Fuqian Huang
---
drivers/ata/libata-sff.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 10aa2
Adamski, Krzysztof (Nokia - PL/Wroclaw)
於 2019年8月7日週三 下午2:51寫道:
>
> On Mon, Aug 05, 2019 at 08:31:34PM +0800, Fuqian Huang wrote:
> >i2c_pxa_handler -> i2c_pxa_irq_txempty ->
> >i2c_pxa_reset -> i2c_pxa_set_slave -> i2c_pxa_wait_slave
> >
> >As i2c_px
in interrupt context, use mdelay instead of msleep.
Signed-off-by: Fuqian Huang
---
drivers/i2c/busses/i2c-pxa.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 2c3c3d6935c0..876e693bafd9 100644
--- a/drivers/i2
As spin_unlock_irq will enable interrupts.
Function tsi108_stat_carry is called from interrupt handler tsi108_irq.
Interrupts are enabled in interrupt handler.
Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
in IRQ context to avoid this.
Signed-off-by: Fuqian Huang
As spin_unlock_irq will enable interrupts.
mxc_rtc_irq_enable is called from interrupt handler mxc_rtc_interrupt.
Interrupts are enabled in interrupt handler.
Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
in IRQ context to avoid this.
Signed-off-by: Fuqian Huang
Remove the redundant initialization code.
Signed-off-by: Fuqian Huang
---
drivers/scsi/lpfc/lpfc_bsg.c | 1 -
drivers/scsi/lpfc/lpfc_sli.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index b7216d694bff..5f66a2da2599 100644
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent/dmam_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the comm
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/at
zalloc has already zeroed the memory.
so memset is unneeded.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Changes in title: gpu: drm -> drm/amdgpu
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 2 --
drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent/dmam_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the comm
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
dri
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/c
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
pci_alloc_consistent calls dma_alloc_coherent directly.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rathe
pci_alloc_consistent calls dma_alloc_coherent directly.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset after these 2 functions is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
-
Replace kmalloc followed by a memset with kzalloc.
There is a recommendation to use zeroing allocator
rather than allocator followed by memset with 0 in
./scripts/coccinelle/api/alloc/zalloc-simple.cocci
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Resend
drivers/mtd/nand/raw/nand_bch.c
Replace kmalloc followed by a memset with kzalloc.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Resend
drivers/media/usb/pvrusb2/pvrusb2-eeprom.c | 3 +--
drivers/media/usb/pvrusb2/pvrusb2-hdw.c| 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/usb
pci_alloc_consistent calls dma_alloc_coherent directly.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent/dmam_alloc_coherent has already zeroed the memory.
So the memset after these 3 function calls is not needed.
Signed-off-by: Fu
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dmam_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/
Use zeroing allocator rather than allocator followed with memset 0.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Resend
drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 3 +--
drivers/staging/rtl8712/rtl871x_io.c | 4 +---
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211
not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/scsi/3w-9xxx.c| 2 --
drivers/scsi/3w-.c| 2 --
drivers/scsi/aacraid/rx.c | 1 -
drivers/scsi/arcmsr/ar
rtw_zmalloc already zeroes the memory,
so memset is unneeded.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Resend
drivers/staging/rtl8723bs/core/rtw_ap.c | 2 --
drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 --
2 files changed, 4 deletions(-)
diff --git a/drivers/staging/rtl8723bs
Replace allocator followed by memset with 0 with zeroing allocator.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Resend
drivers/scsi/lpfc/lpfc_debugfs.c | 5 +
drivers/scsi/qedf/qedf_dbg.c | 3 +--
drivers/scsi/qla2xxx/qla_attr.c | 7 ++-
3 files changed, 4 insertions(+), 11
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
driver
pci_alloc_consistent calls dma_alloc_coherent directly.
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rathe
d.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/net/ethernet/atheros/atlx/atl1.c | 2 --
drivers/net/ethernet/atheros/atlx/atl2.c | 1 -
drivers/net/ethernet/broadcom/b
Replace allocator followed by memset with 0 with zeroing allocator.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Resend
drivers/net/eql.c | 3 +--
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 4 +---
drivers/net/ethernet/cavium/liquidio
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
drivers/v
Use zeroing allocator instead of using allocator
followed with memset with 0
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Resend
kernel/power/swap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index e1912ad13bdc
In commit 518a2f1925c3
("dma-mapping: zero memory returned from dma_alloc_*"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Use actual commit rather than the merge commit in the commit message
sound/ppc/
Use zeroing allocator instead of using allocator followed
with memset with 0.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Resend
sound/core/seq/oss/seq_oss_init.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/core/seq/oss/seq_oss_init.c
b/sound/core/seq
Use zero allocator rather than kmalloc followed with memset with 0.
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Fix pr_warn message.
fs/jffs2/erase.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index 83b8f06b4a64
Replace kmalloc followed by a memset with kzalloc
Signed-off-by: Fuqian Huang
---
Changes in v3:
- Resend
drivers/md/dm-integrity.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index 44e76cda087a..f5db89b28757
Fuqian,
>
> On Mon, Jul 01, 2019 at 11:23:12AM +0800, Fuqian Huang wrote:
> > Using dev_get_drvdata directly.
> >
>
> I prefer using proper bus accessors.
>
> Thanks.
>
> --
> Dmitry
Andy Shevchenko 於 2019年7月2日週二 下午5:51寫道:
>
> On Tue, Jul 2, 2019 at 11:20 AM Fuqian Huang wrote:
> >
> > I am not an expert on this. I just write a coccinelle script to search
> > this kind of misuse and fix it in a naive way.
> > Could you tell me about how to use
kmemdup rather than using kmalloc/kzalloc + memset.
Add an allocation failure check.
Signed-off-by: Fuqian Huang
---
arch/powerpc/platforms/pseries/dlpar.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/dlpar.c
b/arch/powerpc/platforms
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/block/rbd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e5009a34f9c2..47ad3772dc58 100644
--- a/drivers/block/rbd.c
+++ b/drivers
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
arch/ia64/sn/kernel/io_acpi_init.c | 8 +++-
arch/ia64/sn/pci/tioce_provider.c | 3 +--
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/arch/ia64/sn/kernel/io_acpi_init.c
b/arch/ia64/sn
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/clk/ti/dpll.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
index 659dadb23279..f728d987ebac 100644
--- a/drivers/clk/ti/dpll.c
+++ b
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/infiniband/hw/i40iw/i40iw_cm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c
b/drivers/infiniband/hw/i40iw/i40iw_cm.c
index 8233f5a4e623
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/macintosh/adbhid.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index 75482eeab2c4..5d14bebfb58f 100644
--- a/drivers
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/media/dvb-core/dvbdev.c | 3 +--
drivers/media/dvb-frontends/drx39xyj/drxj.c | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/media/tuners/tuner-xc2028.c | 3 +--
drivers/media/tuners/xc4000.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/tuners/tuner-xc2028.c
b/drivers/media/tuners
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/media/usb/em28xx/em28xx-cards.c | 3 +--
drivers/media/usb/zr364xx/zr364xx.c | 4 +---
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c
b/drivers
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/message/fusion/mptbase.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index d8882b0a1338..e0c57cecddd3 100644
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
b/drivers/net/ethernet/mellanox
kmemdup rather than using kmalloc/kzalloc + memset.
Signed-off-by: Fuqian Huang
---
drivers/net/wireless/ath/ath6kl/wmi.c | 6 ++
drivers/net/wireless/st/cw1200/queue.c | 3 +--
drivers/net/wireless/ti/wlcore/main.c | 3 +--
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a
1 - 100 of 278 matches
Mail list logo