]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
um: line: always fill *error_out in setup_one_line()
authorJohannes Berg <johannes.berg@intel.com>
Wed, 3 Jul 2024 15:22:36 +0000 (17:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:06:48 +0000 (11:06 +0200)
[ Upstream commit 824ac4a5edd3f7494ab1996826c4f47f8ef0f63d ]

The pointer isn't initialized by callers, but I have
encountered cases where it's still printed; initialize
it in all possible cases in setup_one_line().

Link: https://patch.msgid.link/20240703172235.ad863568b55f.Iaa1eba4db8265d7715ba71d5f6bb8c7ff63d27e9@changeid
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/drivers/line.c

index 37e96ba0f5fb14f89c9e91aa5cdf5707f4d20570..d2beb4a497a2a8ce2871f90932a49ff0c072b6de 100644 (file)
@@ -378,6 +378,7 @@ int setup_one_line(struct line *lines, int n, char *init,
                        parse_chan_pair(NULL, line, n, opts, error_out);
                        err = 0;
                }
+               *error_out = "configured as 'none'";
        } else {
                char *new = kstrdup(init, GFP_KERNEL);
                if (!new) {
@@ -401,6 +402,7 @@ int setup_one_line(struct line *lines, int n, char *init,
                        }
                }
                if (err) {
+                       *error_out = "failed to parse channel pair";
                        line->init_str = NULL;
                        line->valid = 0;
                        kfree(new);