> The problem is that I don't know if the script is correct
Will the clarification of such a concern evolve into another interesting
software development adventure?
> - I'm not familiar with these string functions.
How are the chances to improve the understanding of affected programming
interfa
From: Markus Elfring
Date: Mon, 2 Jul 2018 18:45:15 +0200
Three function names were specified for a search of function calls
by the means of a disjunction in two rules of a script for
the semantic patch language.
Use a regular expression as a constraint for this source code search
pattern instead
From: Markus Elfring
Date: Mon, 2 Jul 2018 17:55:27 +0200
The metavariable “a” is enclosed by parentheses in three rules of
a script for the semantic patch language.
Replace its type by “expression” so that the corresponding source code
search becomes more powerful.
Signed-off-by: Markus Elfring
From: Markus Elfring
Date: Tue, 3 Jul 2018 09:15:26 +0200
This source code search pattern was programmed in the way that
some implementation details could be improved further.
I suggest to avoid unnecessary code repetition also in this script
for the semantic patch language.
Markus Elfring (6):
>> * The repetition of such a constraint in subsequent SmPL rules could be
>> avoided
>> if inheritance will be used for this metavariable.
>
> This is quite incorrect.
I suggest to consider additional software design options.
> Inheritance is only possible when a match of the previous rule
> For kmalloc()-family allocations, instead of A * B, use array_size().
> Similarly, instead of A * B *C, use array3_size().
It took a while until my software development attention was caught also
by this update suggestion.
> Note that:
> kmalloc(array_size(a, b), ...);
> could be written
> @@ -656,18 +656,18 @@ static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev,
> tsfeed->priv = filter;
>
> ret = tsfeed->set(tsfeed, feed->pid, ts_type, ts_pes, timeout);
> - if (ret < 0) {
> - dmxdev->demux->release_ts_feed(dmxdev->demux, tsfeed);
> - r
> Adjust jump targets so that a bit of exception handling can be better
> reused at the end of these functions.
Why was this update suggestion rejected once more a moment ago?
https://patchwork.linuxtv.org/patch/47827/
lkml.kernel.org/r/<57ef3a56-2578-1d5f-1268-348b49b0c...@users.sourceforge.net>
> Date: Sun, 11 Mar 2018 16:06:16 +0100
>
> Some update suggestions were taken into account
> from static source code analysis.
…
> Delete unnecessary code in user_init_raw_fds()
> Less checks in user_init_raw_fds() after error detection
> Adjust an error message in user_init_socket_fds()
>
>> The mutex was (and is still only) locked within case branches, isn't it?
>>
> You are correct, this does however reflect the issue with the resulting
> lack of balance here.
Do you find changes for the other function implementations easier to integrate?
Regards,
Markus
>> @@ -6501,14 +6501,16 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info
>> *h, void __user *argp)
>> cleanup0:
>> cmd_free(h, c);
>> cleanup1:
>> - if (buff) {
>> + {
>> int i;
>>
>> for (i = 0; i < sg_used; i++)
>>
>> The mutex was (and is still only) locked within case branches, isn't it?
>>
> You are correct, this does however reflect the issue with the resulting
> lack of balance here.
I suggest to reconsider affected software aspects a bit more.
> I saw the mutex was getting unlocked outside the local
Am 17.03.2018 um 20:54 schrieb Jonathan Cameron:
> On Wed, 14 Mar 2018 16:15:32 +0100
> SF Markus Elfring wrote:
>
>> From: Markus Elfring
>> Date: Wed, 14 Mar 2018 16:06:49 +0100
>>
>> * Add jump targets so that a call of the function "mutex_unlock"
From: Markus Elfring
Date: Thu, 15 Mar 2018 14:56:10 +0100
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/net/ethernet/chelsio/cxgb4/cud
>> Move an assignment for a specific error code so that it is stored only once
>> in this function implementation.
>>
>> This issue was detected by using the Coccinelle software.
>
> How?
Would you like to experiment a bit more with the following approach
for the semantic patch language?
show_sa
From: Markus Elfring
Date: Wed, 14 Mar 2018 22:02:52 +0100
Move an assignment for a specific error code so that it is stored only once
in this function implementation.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/media/i2c/ov5645.c | 6 +-
From: Markus Elfring
Date: Wed, 14 Mar 2018 16:06:49 +0100
* Add jump targets so that a call of the function "mutex_unlock" is stored
only once in these function implementations.
* Replace 19 calls by goto statements.
This issue was detected by using the Coccinelle software.
Signed-off-by: M
From: Markus Elfring
Date: Tue, 13 Mar 2018 20:52:26 +0100
* Add a jump target so that a call of the function "mutex_unlock" is stored
only once in this function implementation.
* Replace two calls by goto statements.
This issue was detected by using the Coccinelle software.
Signed-off-by: M
From: Markus Elfring
Date: Tue, 13 Mar 2018 20:08:40 +0100
* Add a jump target so that a call of the function "mutex_unlock" is stored
only once in this function implementation.
* Replace three calls by goto statements.
This issue was detected by using the Coccinelle software.
Signed-off-by:
From: Markus Elfring
Date: Tue, 13 Mar 2018 13:40:12 +0100
* Add jump targets so that a call of the function "mutex_unlock" is stored
less often in these function implementations.
* Replace eight calls by goto statements.
This issue was detected by using the Coccinelle software.
Signed-off-b
> 1 file changed, 29 insertions(+), 31 deletions(-)
>
> So you are asking people to review 60 changed lines to save 2,
A bit of object code reduction might become useful also in this case.
> that alone should be the point where you stop yourself from
> *even* sending this patch.
I proposed ju
>> Adjust jump targets so that a bit of exception handling can be better
>> reused at the end of this function.
…
> goto-s going to a label calling another goto is completely unreadable.
I got an other software development view.
> I really do not see any reason for the proposed changes,
I sugge
>> Add a jump target so that the setting of a specific error code is stored
>> only once at the end of this function.
>>
>> Signed-off-by: Markus Elfring
>> ---
>> drivers/bluetooth/btmrvl_sdio.c | 13 +++--
>> 1 file changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/bluet
>> @@ -797,12 +792,18 @@ static int btmrvl_sdio_card_to_host(struct
>> btmrvl_private *priv)
>> break;
>> }
>>
>> -exit:
>> -if (ret) {
>> -hdev->stat.err_rx++;
>> -kfree_skb(skb);
>> -}
>> +return 0;
>> +
>> +free_skb:
>> +kfree_skb(skb);
>> Use three values directly for a condition check without assigning them
>> to intermediate variables.
>
> Hi,
>
> what is the benefit of this?
I proposed a small source code reduction.
Other software design directions might become more interesting for this use
case.
Regards,
Markus
> How have you managed to insert 4 patches into the x/17 thread?
I dared to group the desired patch series into dedicated mail threads.
Regards,
Markus
> +set_error_code:
> + err = -errno;
> + os_close_file(rxfd);
I have taken another look at this change idea.
Now I notice that I should have preserved a sanity check there.
if (rxfd >= 0)
os_close_file(rxfd);
Regards,
Markus
From: Markus Elfring
Date: Mon, 12 Mar 2018 22:15:59 +0100
Adjust jump targets so that a bit of exception handling can be better
reused at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/hwmon/sch5627.c | 60 +++
From: Markus Elfring
Date: Mon, 12 Mar 2018 16:23:53 +0100
Add a jump target so that a specific error code is assigned to the
local variable "res" at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/edac/altera_edac.
> Date: Sun, 22 Oct 2017 16:46:34 +0200
>
> Add a jump target so that a bit of exception handling can be better reused
> at the end of these functions.
How are the chances to integrate such a change into another Linux repository?
https://lkml.org/lkml/2017/10/22/78
https://patchwork.kernel.org/pa
From: Markus Elfring
Date: Mon, 12 Mar 2018 14:18:23 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/crypto/talitos.c | 1 -
1 file changed, 1 deletion(-)
diff --
From: Markus Elfring
Date: Mon, 12 Mar 2018 14:08:55 +0100
Add jump targets so that an error message and the setting of a specific
error code is stored only once at the end of this function.
Signed-off-by: Markus Elfring
---
drivers/crypto/talitos.c | 24
1 file change
From: Markus Elfring
Date: Mon, 12 Mar 2018 14:24:34 +0100
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Use common error handling code
Delete an error message for a failed memory allocation
drivers/crypto/talitos.c | 25 --
From: Markus Elfring
Date: Mon, 12 Mar 2018 11:30:28 +0100
Add a jump target so that the setting of a specific error code is stored
only once at the end of this function.
Signed-off-by: Markus Elfring
---
drivers/bluetooth/btmrvl_sdio.c | 13 +++--
1 file changed, 7 insertions(+), 6 de
From: Markus Elfring
Date: Mon, 12 Mar 2018 11:15:59 +0100
The variable "payload" will eventually be set to an appropriate pointer
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring
---
drivers/bluetooth/btmrvl_sdio.c | 2 +-
1 file changed, 1 in
From: Markus Elfring
Date: Mon, 12 Mar 2018 11:13:00 +0100
One check could be repeated by the btmrvl_sdio_card_to_host() function
during error handling even if the relevant properties can be determined
for the involved variables before by source code analysis.
* Adjust jump targets so that an ex
From: Markus Elfring
Date: Mon, 12 Mar 2018 10:20:04 +0100
The local variable "ret" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring
---
drivers/bluetooth/btmrvl_sdio.c | 2 +-
1 file changed, 1 insertion(+),
From: Markus Elfring
Date: Mon, 12 Mar 2018 10:15:17 +0100
Adjust a jump target so that a bit of exception handling can be better
reused at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/bluetooth/btmrvl_sdio.c | 5
From: Markus Elfring
Date: Mon, 12 Mar 2018 12:10:24 +0100
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (5):
Use common error handling code in btmrvl_sdio_register_dev()
Delete an unnecessary variable initialisation in btmrvl_sdio_register
From: Markus Elfring
Date: Sun, 11 Mar 2018 15:50:29 +0100
The local variable "fd" will eventually be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring
---
arch/um/drivers/vector_user.c | 3 +--
1 file changed, 1 inse
From: Markus Elfring
Date: Sun, 11 Mar 2018 15:43:31 +0100
Three checks could be repeated by the user_init_tap_fds() function
during error handling even if the relevant properties can be determined
for the involved variables before by source code analysis.
* Adjust jump targets.
* Delete three
From: Markus Elfring
Date: Sun, 11 Mar 2018 15:10:05 +0100
Adjust an error message at the end of this function so that its name
will be automatically determined as a parameter.
Signed-off-by: Markus Elfring
---
arch/um/drivers/vector_user.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(
From: Markus Elfring
Date: Sun, 11 Mar 2018 14:56:38 +0100
Two checks could be repeated by the user_init_socket_fds() function
during error handling even if the relevant properties can be determined
for the involved variables before by source code analysis.
* Adjust jump targets.
* Delete two s
From: Markus Elfring
Date: Sun, 11 Mar 2018 14:20:46 +0100
The implementation returns from this function if a null pointer
was detected in the local variable "gairesult". Thus the check
before two calls of the function "freeaddrinfo" is not needed.
Signed-off-by: Markus Elfring
---
arch/um/dri
From: Markus Elfring
Date: Sun, 11 Mar 2018 14:00:09 +0100
The kfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.
Signed-off-by: Markus Elfring
---
arch/um/drivers/vector_user.c | 3 +--
1 file changed, 1 insertion(+),
From: Markus Elfring
Date: Sun, 11 Mar 2018 13:53:08 +0100
* Adjust an error message at the end of this function.
* Delete the local variable "err" which became unnecessary
with this refactoring.
Signed-off-by: Markus Elfring
---
arch/um/drivers/vector_user.c | 5 +++--
1 file changed, 3 in
From: Markus Elfring
Date: Sun, 11 Mar 2018 11:40:14 +0100
Up to two checks could be repeated by the user_init_raw_fds() function
during error handling even if the relevant properties can be determined
for the involved variables before by source code analysis.
* Adjust jump targets so that an ex
From: Markus Elfring
Date: Sun, 11 Mar 2018 11:36:18 +0100
* One condition check could never be reached with a non-null pointer
at the end of this function. Thus remove the corresponding statement.
* Delete an initialisation for the local variable "result"
which became unnecessary with this
From: Markus Elfring
Date: Sun, 11 Mar 2018 16:06:16 +0100
Some update suggestions were taken into account
from static source code analysis.
Markus Elfring (9):
Delete unnecessary code in user_init_raw_fds()
Less checks in user_init_raw_fds() after error detection
Adjust an error message i
From: Markus Elfring
Date: Sun, 11 Mar 2018 09:03:42 +0100
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
arch/powerpc/kernel/machine_kexec_file
From: Markus Elfring
Date: Sat, 10 Mar 2018 22:18:45 +0100
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/net/wireless/ti/wlcore/acx.c |
From: Markus Elfring
Date: Sat, 10 Mar 2018 22:00:31 +0100
Return directly after a call of the function "kzalloc" failed
at the beginning.
Signed-off-by: Markus Elfring
---
drivers/net/wireless/ti/wlcore/acx.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/n
From: Markus Elfring
Date: Sat, 10 Mar 2018 21:51:17 +0100
The local variable "ret" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring
---
drivers/net/wireless/ti/wlcore/acx.c | 2 +-
1 file changed, 1 insertio
From: Markus Elfring
Date: Sat, 10 Mar 2018 22:25:45 +0100
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete an unnecessary variable initialisation
Return directly after a failed kzalloc()
Use common error handling code
drivers/
From: Markus Elfring
Date: Sat, 10 Mar 2018 18:53:28 +0100
Use three values directly for a condition check without assigning them
to intermediate variables.
Signed-off-by: Markus Elfring
---
drivers/net/usb/ax88179_178a.c | 13 ++---
1 file changed, 6 insertions(+), 7 deletions(-)
dif
From: Markus Elfring
Date: Sat, 10 Mar 2018 18:22:43 +0100
Adjust a jump target so that a bit of common code can be better reused
at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/net/usb/ax88179_178a.c | 34 ++
From: Markus Elfring
Date: Sat, 10 Mar 2018 19:05:45 +0100
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Use common code
Delete three unnecessary variables
drivers/net/usb/ax88179_178a.c | 45 +++---
From: Markus Elfring
Date: Fri, 9 Mar 2018 21:00:12 +0100
Adjust jump targets so that a bit of exception handling can be better
reused at the end of these functions.
This issue was partly detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v3:
Laurent Pinchart and Tod
From: Markus Elfring
Date: Fri, 9 Mar 2018 09:56:31 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
From: Markus Elfring
Date: Fri, 9 Mar 2018 09:49:32 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
From: Markus Elfring
Date: Fri, 9 Mar 2018 09:45:13 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
From: Markus Elfring
Date: Fri, 9 Mar 2018 09:19:42 +0100
Move the assignment for the local variable "dev" so that its setting
will be performed after a configuration check by this function.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebas
From: Markus Elfring
Date: Fri, 9 Mar 2018 09:10:09 +0100
The local variable "dev" will be reassigned by a following statement.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
on s
From: Markus Elfring
Date: Fri, 9 Mar 2018 09:06:14 +0100
The local variable "ret" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
From: Markus Elfring
Date: Fri, 9 Mar 2018 09:00:59 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
From: Markus Elfring
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (4):
Delete an error message for a failed memory allocation in tps65910_parse_dt()
Delete an unnecessary variable initialisation in four functions
Delete an unnecessary va
From: Markus Elfring
Date: Thu, 8 Mar 2018 15:30:54 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
From: Markus Elfring
Date: Thu, 8 Mar 2018 15:25:58 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
From: Markus Elfring
Date: Thu, 8 Mar 2018 15:15:51 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
From: Markus Elfring
Date: Thu, 8 Mar 2018 15:05:16 +0100
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.
This issue was dete
From: Markus Elfring
Date: Thu, 8 Mar 2018 14:20:06 +0100
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written …
Thus fix the affected source code places.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch.
From: Markus Elfring
Date: Thu, 8 Mar 2018 14:05:41 +0100
Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detect
From: Markus Elfring
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Improve a size determination in two functions
Adjust 12 checks for null pointers
---
v2:
Lee Jones requested a resend for these patches. The changes were rebased
on so
From: Markus Elfring
Date: Thu, 8 Mar 2018 13:45:31 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Lee Jones requested a resend for this patch. The change was rebased
From: Markus Elfring
Date: Thu, 8 Mar 2018 12:50:12 +0100
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written …
Thus fix the affected source code places.
Signed-off-by: Markus Elfring
Reviewed-by: Linus Walleij
---
v2:
Lee Jones request
From: Markus Elfring
Date: Thu, 8 Mar 2018 12:46:47 +0100
Replace the specification of two data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was de
From: Markus Elfring
Date: Thu, 8 Mar 2018 11:44:33 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
Reviewed-by: Linus Walleij
---
v2:
Lee Jones requested a resend for this p
From: Markus Elfring
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete an error message for a failed memory allocation
in abx500_register_ops()
Improve two size determinations in abx500_register_ops()
Adjust 14 checks for null
From: Markus Elfring
Date: Fri, 9 Mar 2018 10:24:42 +0100
Several update suggestions were taken into account
from static source code analysis.
Markus Elfring (17):
abx500-core: Adjustments for eight function implementations
si476x-i2c: Delete an error message for a failed memory allocation
From: Markus Elfring
Date: Mon, 5 Mar 2018 17:00:19 +0100
Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detect
From: Markus Elfring
Date: Mon, 5 Mar 2018 16:40:29 +0100
* Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.
This issue was detected by using the Coccinelle software.
* Return directly after this function call failed at the beginning.
* Delete the l
From: Markus Elfring
Date: Mon, 5 Mar 2018 17:12:34 +0100
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Use memdup_user() rather than duplicating its implementation
Improve a size determination in two functions
drivers/misc/vmw_vmci/vm
From: Markus Elfring
Date: Mon, 5 Mar 2018 13:50:13 +0100
Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/crypto/ccp/psp-dev.c | 15 +--
1
From: Markus Elfring
Date: Mon, 5 Mar 2018 11:33:21 +0100
Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
drivers/mmc/core/block.c | 15 ---
1 file
From: Markus Elfring
Date: Sun, 4 Mar 2018 22:16:05 +0100
Move an assignment for the local variable "sg_used" so that its setting
will only be performed after corresponding memory allocations succeeded
by this function.
Signed-off-by: Markus Elfring
---
drivers/scsi/hpsa.c | 3 ++-
1 file chan
From: Markus Elfring
Date: Sun, 4 Mar 2018 22:02:10 +0100
The variable "status" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring
---
drivers/scsi/hpsa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Markus Elfring
Date: Sun, 4 Mar 2018 22:00:19 +0100
The function "kfree" was called in a few cases by
the hpsa_big_passthru_ioctl() function during error handling
even if the passed variable contained a null pointer.
* Adjust jump targets.
* Delete two initialisations and a check (for the
From: Markus Elfring
Date: Sun, 4 Mar 2018 21:19:52 +0100
* Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.
This issue was detected by using the Coccinelle software.
* Return directly after this function call failed at the beginning.
Signed-off-by:
From: Markus Elfring
Date: Mon, 5 Mar 2018 09:14:32 +0100
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (4):
Use memdup_user() rather than duplicating its implementation
Less function calls in hpsa_big_passthru_ioctl() after error detection
>> +put_isp:
>> +omap3isp_put(video->isp);
>> +delete_fh:
>> +v4l2_fh_del(&handle->vfh);
>> +v4l2_fh_exit(&handle->vfh);
>> +kfree(handle);
>
> Please prefix the error labels with error_.
How often do you really need such an extra prefix?
>> +++ b/drivers/media/usb/uvc/uvc_v4l2.
>> Can a passed null pointer really work in this function?
>>
>> https://elixir.bootlin.com/linux/v4.16-rc2/source/include/crypto/hash.h#L684
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/crypto/hash.h?id=0f9da844d87796ac31b04e81ee95e155e9043132#n751
>>
>> stati
> Calling crypto_free_shash(NULL) is actually fine.
Really?
> It doesn't dereference the parameter, it just does pointer math on it in
> crypto_shash_tfm() and returns if it's NULL in crypto_destroy_tfm().
Can a passed null pointer really work in this function?
https://elixir.bootlin.com/linux
> This patch is pointless as kfree on NULL is a no-op.
I prefer to avoid unnecessary function calls generally.
Regards,
Markus
> You're 1/8 patch had an actual bug fix hidden amongst the style churn.
It showed the general possibility to adjust the source code structure
for the function “chap_server_compute_md5” also because of the usage
of the single jump label “out” before.
> I don't see any such fixes in the other pat
>> @@ -1032,14 +1032,13 @@ static int omap_aes_get_res_pdev(struct omap_aes_dev
>> *dd,
>> static int omap_aes_probe(struct platform_device *pdev)
>> {
>> struct device *dev = &pdev->dev;
>> -struct omap_aes_dev *dd;
>> struct crypto_alg *algp;
>> struct aead_alg *aalg;
>>
From: Markus Elfring
Date: Thu, 22 Feb 2018 21:45:47 +0100
Some local variables will be set to an appropriate value before usage.
Thus omit explicit initialisations at the beginning of these functions.
Signed-off-by: Markus Elfring
---
v2:
Hans Verkuil insisted on patch squashing. Thus some ch
> Date: Tue, 12 Dec 2017 22:22:11 +0100
>
> Some update suggestions were taken into account
> from static source code analysis.
>
> Markus Elfring (8):
> Less function calls in chap_server_compute_md5() after error detection
> Move resetting of seven variables in chap_server_compute_md5()
>
From: Markus Elfring
Date: Mon, 19 Feb 2018 18:50:40 +0100
Adjust jump targets so that a bit of exception handling can be better
reused at the end of these functions.
This issue was partly detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Hans Verkuil insisted o
From: Markus Elfring
Date: Fri, 16 Feb 2018 18:19:13 +0100
* Return a result code without storing it in an intermediate variable.
* Reduce the needed source code.
Signed-off-by: Markus Elfring
---
drivers/ata/libata-scsi.c | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --gi
From: Markus Elfring
Date: Fri, 16 Feb 2018 16:42:26 +0100
Move assignments for the local variables "irq_handler" and "pdata"
so that their setting will only be performed after a call
of the function "devm_kzalloc" succeeded by this function.
Thus adjust a corresponding if statement.
Signed-off-
1 - 100 of 1284 matches
Mail list logo