• Douglas Anderson's avatar
    kdb: Fix "btc <cpu>" crash if the CPU didn't round up · 55a7e23f
    Douglas Anderson authored
    I noticed that when I did "btc <cpu>" and the CPU I passed in hadn't
    rounded up that I'd crash.  I was going to copy the same fix from
    commit 162bc7f5 ("kdb: Don't back trace on a cpu that didn't round
    up") into the "not all the CPUs" case, but decided it'd be better to
    clean things up a little bit.
    
    This consolidates the two code paths.  It is _slightly_ wasteful in in
    that the checks for "cpu" being too small or being offline isn't
    really needed when we're iterating over all online CPUs, but that
    really shouldn't hurt.  Better to have the same code path.
    
    While at it, eliminate at least one slightly ugly (and totally
    needless) recursive use of kdb_parse().
    Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
    Acked-by: default avatarWill Deacon <will@kernel.org>
    Signed-off-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
    55a7e23f
kdb_bt.c 5.38 KB