Patch "visorbus: fix error return code in visorchipset_init()" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    visorbus: fix error return code in visorchipset_init()

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     visorbus-fix-error-return-code-in-visorchipset_init.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 07d4bf7be1576e7ca9a863c9e39e2e3cd4744a87
Author: Zhen Lei <thunder.leizhen@xxxxxxxxxx>
Date:   Fri May 28 16:26:14 2021 +0800

    visorbus: fix error return code in visorchipset_init()
    
    [ Upstream commit ce52ec5beecc1079c251f60e3973b3758f60eb59 ]
    
    Commit 1366a3db3dcf ("staging: unisys: visorbus: visorchipset_init clean
    up gotos") assigns the initial value -ENODEV to the local variable 'err',
    and the first several error branches will return this value after "goto
    error". But commit f1f537c2e7f5 ("staging: unisys: visorbus: Consolidate
    controlvm channel creation.") overwrites 'err' in the middle of the way.
    As a result, some error branches do not successfully return the initial
    value -ENODEV of 'err', but return 0.
    
    In addition, when kzalloc() fails, -ENOMEM should be returned instead of
    -ENODEV.
    
    Fixes: f1f537c2e7f5 ("staging: unisys: visorbus: Consolidate controlvm channel creation.")
    Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
    Signed-off-by: Zhen Lei <thunder.leizhen@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210528082614.9337-1-thunder.leizhen@xxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/visorbus/visorchipset.c b/drivers/visorbus/visorchipset.c
index cb1eb7e05f87..5668cad86e37 100644
--- a/drivers/visorbus/visorchipset.c
+++ b/drivers/visorbus/visorchipset.c
@@ -1561,7 +1561,7 @@ schedule_out:
 
 static int visorchipset_init(struct acpi_device *acpi_device)
 {
-	int err = -ENODEV;
+	int err = -ENOMEM;
 	struct visorchannel *controlvm_channel;
 
 	chipset_dev = kzalloc(sizeof(*chipset_dev), GFP_KERNEL);
@@ -1584,8 +1584,10 @@ static int visorchipset_init(struct acpi_device *acpi_device)
 				 "controlvm",
 				 sizeof(struct visor_controlvm_channel),
 				 VISOR_CONTROLVM_CHANNEL_VERSIONID,
-				 VISOR_CHANNEL_SIGNATURE))
+				 VISOR_CHANNEL_SIGNATURE)) {
+		err = -ENODEV;
 		goto error_delete_groups;
+	}
 	/* if booting in a crash kernel */
 	if (is_kdump_kernel())
 		INIT_DELAYED_WORK(&chipset_dev->periodic_controlvm_work,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux