06 Dec, 2016
2 commits
-
It returns variable "error" when ioremap_nocache() returns a NULL
pointer. The value of "error" is 0 then, which will mislead the callers
to believe that there is no error. This patch fixes the bug, returning
"-ENOMEM".Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189021
Signed-off-by: Pan Bian
Signed-off-by: David S. Miller -
In function lanai_dev_open(), when the call to ioremap() fails, the
value of return variable result is 0. 0 means no error in this context.
This patch fixes the bug, assigning "-ENOMEM" to result when ioremap()
returns a NULL pointer.Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188791
Signed-off-by: Pan Bian
Signed-off-by: David S. Miller
16 Sep, 2016
1 commit
-
The newline escape is incorrect and needs fixing. Also adjust source
formatting / indentation and add { } to trailing else.Signed-off-by: Colin Ian King
Signed-off-by: David S. Miller
11 Sep, 2016
9 commits
-
Adjust the indentation for a call of the macro "DPRINTK" in this function.
Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
* The script "checkpatch.pl" can point information out like the following.
WARNING: Prefer kcalloc over kzalloc with multiply
Thus fix the affected source code place.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.* Delete the local variable "size" which became unnecessary with
this refactoring.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
The script "checkpatch.pl" can point out that assignments should usually
not be performed within condition checks.
Thus move an assignment for a local variable to a separate statement
in this function.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
* The script "checkpatch.pl" can point out that assignments should usually
not be performed within condition checks.
Thus move an assignment for a local variable to a separate statement
in this function.* Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
Replace the specification of a data structure by a reference for a field
in a local variable as the parameter for the operator "sizeof" to make
the corresponding size determination a bit safer according to
the Linux coding style convention.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller
10 Sep, 2016
3 commits
-
* Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the corresponding function "kmalloc_array".This issue was detected by using the Coccinelle software.
* Replace the specification of data types by pointer dereferences
to make the corresponding size determination a bit safer according to
the Linux coding style convention.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
* Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the corresponding function "kmalloc_array".This issue was detected by using the Coccinelle software.
* Replace the specification of data types by pointer dereferences
to make the corresponding size determination a bit safer according to
the Linux coding style convention.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller -
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".This issue was detected by using the Coccinelle software.
* Replace the specification of a data structure by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.Signed-off-by: Markus Elfring
Signed-off-by: David S. Miller
19 Aug, 2016
1 commit
-
The data member of structure firmware is const and this constness is
dropped by some cast.
This patch add some const for keeping the const information.Signed-off-by: LABBE Corentin
Signed-off-by: David S. Miller
20 Jul, 2016
1 commit
-
In 'get_scq', 'dma_alloc_coherent' has been used to allocate some
resources, so we need to free them using 'dma_free_coherent' instead
of 'kfree'.Signed-off-by: Christophe JAILLET
Signed-off-by: David S. Miller
01 Jul, 2016
1 commit
-
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.The Coccinelle semantic patch that fixes this problem is
as follows:
@@
expression t,d,f,e1;
identifier x1;
statement S1;
@@(
-t.data = d;
|
-t.function = f;
|
-init_timer(&t);
+setup_timer(&t,f,d);
|
-init_timer_on_stack(&t);
+setup_timer_on_stack(&t,f,d);
)Signed-off-by: Amitoj Kaur Chawla
Signed-off-by: David S. Miller
01 Jun, 2016
2 commits
-
The iadev->rx_open[] array holds "iadev->num_vc" pointers (this code
assumes that pointers are 32 bits). So the > here should be >= or else
we could end up reading a garbage pointer from one element beyond the
end of the array.Signed-off-by: Dan Carpenter
Signed-off-by: David S. Miller -
This bug was there when the driver was first added in back in year 2000.
It causes a Smatch warning:drivers/atm/firestream.c:849 process_incoming()
error: buffer overflow 'res_strings' 60
Signed-off-by: David S. Miller
18 Mar, 2016
1 commit
-
Pull trivial tree updates from Jiri Kosina.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
drivers/rtc: broken link fix
drm/i915 Fix typos in i915_gem_fence.c
Docs: fix missing word in REPORTING-BUGS
lib+mm: fix few spelling mistakes
MAINTAINERS: add git URL for APM driver
treewide: Fix typo in printk
15 Feb, 2016
1 commit
-
This patch fix spelling typos found in printk and Kconfig.
Signed-off-by: Masanari Iida
Acked-by: Randy Dunlap
Signed-off-by: Jiri Kosina
30 Dec, 2015
1 commit
-
Use to_pci_dev() instead of open-coding it.
Signed-off-by: Geliang Tang
Signed-off-by: David S. Miller
06 Dec, 2015
1 commit
-
The simple_strtol function is obsolete.
This patch replace it by kstrtoint.
This will simplify code, since some error case not handled by
simple_strtol are handled by kstrtoint.Signed-off-by: LABBE Corentin
Signed-off-by: David S. Miller
13 Oct, 2015
2 commits
-
Fix a smatch warning:
drivers/atm/iphase.c:1178 rx_pkt() warn: curly braces intended?The code is correct, the indention is misleading. In case the allocation
of skb fails, we want to skip to the end.Signed-off-by: Tillmann Heidsieck
Signed-off-by: David S. Miller -
Smatch complains about returning hard coded error codes, silence this
warning.drivers/atm/iphase.c:115 ia_enque_rtn_q() warn: returning -1 instead of -ENOMEM is sloppy
Signed-off-by: Tillmann Heidsieck
Signed-off-by: David S. Miller
18 Sep, 2015
1 commit
-
A comment in include/linux/skbuff.h says that:
* Various parts of the networking layer expect at least 32 bytes of
* headroom, you should not reduce this.This was demonstrated by a panic when handling fragmented IPv6 packets:
http://marc.info/?l=linux-netdev&m=144236093519172&w=2It's not entirely clear if that comment is still valid — and if it is,
perhaps netif_rx() ought to be enforcing it with a warning.But either way, it is rather stupid from a performance point of view
for us to be receiving packets into a buffer which doesn't have enough
room to prepend an Ethernet header — it means that *every* incoming
packet is going to be need to be reallocated. So let's fix that.Signed-off-by: David Woodhouse
Acked-by: Eric Dumazet
Signed-off-by: David S. Miller
16 Sep, 2015
1 commit
-
Remove unneeded NULL test.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@@ expression x; @@
-if (x != NULL)
\(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
//Signed-off-by: Julia Lawall
Signed-off-by: David S. Miller
11 Jun, 2015
1 commit
-
Use the timer API function setup_timer instead of structure field
assignments to initialize a timer.A simplified version of the Coccinelle semantic patch that performs
this transformation is as follows:@change@
expression e1, e2, a;
@@-init_timer(&e1);
+setup_timer(&e1, a, 0UL);
... when != a = e2
-e1.function = a;Signed-off-by: Vaishali Thakkar
Signed-off-by: David S. Miller
09 Jun, 2015
1 commit
-
API compliance scanning with coccinelle flagged:
./drivers/atm/iphase.c:2621:4-20:
WARNING: timeout (50) seems HZ dependentNumeric constants passed to schedule_timeout() make the effective
timeout HZ dependent which does not seem intended.
Fixed up by converting the constant to jiffies with msecs_to_jiffies()
As this driver was introduced in the early 2.3 series it is most
likely assuming HZ=100 so the constant 50 is converted to 500ms.Signed-off-by: Nicholas Mc Guire
Signed-off-by: David S. Miller
05 Jun, 2015
1 commit
-
According to false is always '0' and
Static variables are initialised to 0 by GCC.Signed-off-by: Shailendra Verma
Signed-off-by: David S. Miller
26 May, 2015
1 commit
-
The variable irq_coalesce is bool type.
So assign the value true instead of 1.Signed-off-by: Shailendra Verma
Signed-off-by: David S. Miller
11 Mar, 2015
1 commit
-
remove dead code.
Signed-off-by: Florian Westphal
Signed-off-by: David S. Miller
18 Jan, 2015
1 commit
-
Signed-off-by: Chas Williams - CONTRACTOR
Signed-off-by: David S. Miller
14 Jan, 2015
2 commits
-
Removes some functions that are not used anywhere:
channel_to_vpivci() query_tx_channel_config() rx_disabled_handler()This was partially found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist
Signed-off-by: David S. Miller -
Remove the function aal5_spacefor() that is not used anywhere.
This was partially found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist
Signed-off-by: David S. Miller
15 Dec, 2014
1 commit
-
Pull driver core update from Greg KH:
"Here's the set of driver core patches for 3.19-rc1.They are dominated by the removal of the .owner field in platform
drivers. They touch a lot of files, but they are "simple" changes,
just removing a line in a structure.Other than that, a few minor driver core and debugfs changes. There
are some ath9k patches coming in through this tree that have been
acked by the wireless maintainers as they relied on the debugfs
changes.Everything has been in linux-next for a while"
* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
fs: debugfs: add forward declaration for struct device type
firmware class: Deletion of an unnecessary check before the function call "vunmap"
firmware loader: fix hung task warning dump
devcoredump: provide a one-way disable function
device: Add dev__once variants
ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
ath: use seq_file api for ath9k debugfs files
debugfs: add helper function to create device related seq_file
drivers/base: cacheinfo: remove noisy error boot message
Revert "core: platform: add warning if driver has no owner"
drivers: base: support cpu cache information interface to userspace via sysfs
drivers: base: add cpu_device_create to support per-cpu devices
topology: replace custom attribute macros with standard DEVICE_ATTR*
cpumask: factor out show_cpumap into separate helper function
driver core: Fix unbalanced device reference in drivers_probe
driver core: fix race with userland in device_add()
sysfs/kernfs: make read requests on pre-alloc files use the buffer.
sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
fs: sysfs: return EGBIG on write if offset is larger than file size
...
30 Nov, 2014
1 commit
24 Nov, 2014
1 commit
-
Return a negative error code on failure.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)//
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
//Signed-off-by: Julia Lawall
Signed-off-by: David S. Miller
22 Nov, 2014
1 commit
-
Added a pci_dma_mapping_error() call to check for mapping errors before
further using the dma handle. In case of error, control goes to a new label
where the incoming skb is freed. Unchecked dma handles were found using
Coccinelle:@rule1@
expression e1;
identifier x;
@@*x = pci_map_single(...);
... when != pci_dma_mapping_error(e1,x)Signed-off-by: Tina Johnson
Acked-by: Julia Lawall
Signed-off-by: David S. Miller