mbox series

[0/5] hp-bioscfg: Address memory leaks and uninitialized variable errors

Message ID 20230725220056.25560-1-jorge.lopez2@hp.com (mailing list archive)
Headers show
Series hp-bioscfg: Address memory leaks and uninitialized variable errors | expand

Message

Jorge Lopez July 25, 2023, 10 p.m. UTC
Submit individual patches to address memory leaks and uninitialized 
variable errors for each source file listed below.

- hp_populate_string_elements_from_package()
drivers/platform/x86/hp/hp-bioscfg/string-attributes.c

- hp_populate_ordered_list_elements_from_package()
drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c

- hp_populate_integer_elements_from_package()
drivers/platform/x86/hp/hp-bioscfg/int-attributes.c

- hp_populate_enumeration_elements_from_package()
drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c

- hp_populate_password_elements_from_package()
drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c

Changes were tested with a HP EliteBook x360 1030 G3


Jorge Lopez (5):
  hp-bioscfg: Fix memory leaks in string_elements_from_package()
  hp-bioscfg: Fix memory leaks in ordered_list_elements_from_package
  hp-bioscfg: Fix memory leaks in integer_elements_from_package
  hp-bioscfg: Fix memory leaks in enumeration_elements_from_package()
  hp-bioscfg: Fix memory leaks in password_elements_from_package()

 drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c   |  8 +++++++-
 drivers/platform/x86/hp/hp-bioscfg/int-attributes.c    |  7 ++++++-
 .../platform/x86/hp/hp-bioscfg/order-list-attributes.c | 10 ++++++++--
 .../platform/x86/hp/hp-bioscfg/passwdobj-attributes.c  | 10 +++++++++-
 drivers/platform/x86/hp/hp-bioscfg/string-attributes.c |  5 ++++-
 5 files changed, 34 insertions(+), 6 deletions(-)

Comments

Hans de Goede July 26, 2023, 2:28 p.m. UTC | #1
Hi Jorge,

On 7/26/23 00:00, Jorge Lopez wrote:
> Submit individual patches to address memory leaks and uninitialized 
> variable errors for each source file listed below.
> 
> - hp_populate_string_elements_from_package()
> drivers/platform/x86/hp/hp-bioscfg/string-attributes.c
> 
> - hp_populate_ordered_list_elements_from_package()
> drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c
> 
> - hp_populate_integer_elements_from_package()
> drivers/platform/x86/hp/hp-bioscfg/int-attributes.c
> 
> - hp_populate_enumeration_elements_from_package()
> drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
> 
> - hp_populate_password_elements_from_package()
> drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
> 
> Changes were tested with a HP EliteBook x360 1030 G3

Thank you for the patches fixing this.

I'm going to wait a bit with applying these to give other people who have looked at these issues a chance to review these patches (added Dan Carpenter and Christophe JAILLET to the To: list).

For future patches please write one patch for each issue you are addressing instead of one patch per file. Since the fixes are the same for all 5 files in this case that would have meant doing 2 patches:

1. To fix the memory leak errors in all 5 files
2. To fix the uninitialized variable in all 5 files.

There is no need to send a new version unless changes are requested by one of the reviewers, I'll just squash all these 5 patches into 1 patch when merging this (and keep the uninitialized variable changes as part of the same patch).

Also these patches should have something like this as part of the commit msg (directly above your Signed-off-by:) :

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/platform-driver-x86/176e14a2-41f8-41b2-854e-77319ec2416d@moroto.mountain/

Regards,

Hans








> 
> 
> Jorge Lopez (5):
>   hp-bioscfg: Fix memory leaks in string_elements_from_package()
>   hp-bioscfg: Fix memory leaks in ordered_list_elements_from_package
>   hp-bioscfg: Fix memory leaks in integer_elements_from_package
>   hp-bioscfg: Fix memory leaks in enumeration_elements_from_package()
>   hp-bioscfg: Fix memory leaks in password_elements_from_package()
> 
>  drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c   |  8 +++++++-
>  drivers/platform/x86/hp/hp-bioscfg/int-attributes.c    |  7 ++++++-
>  .../platform/x86/hp/hp-bioscfg/order-list-attributes.c | 10 ++++++++--
>  .../platform/x86/hp/hp-bioscfg/passwdobj-attributes.c  | 10 +++++++++-
>  drivers/platform/x86/hp/hp-bioscfg/string-attributes.c |  5 ++++-
>  5 files changed, 34 insertions(+), 6 deletions(-)
>