]> git.sur5r.net Git - openocd/commitdiff
stlink: check read_reg result
authorSpencer Oliver <spen@spen-soft.co.uk>
Tue, 22 May 2012 11:33:40 +0000 (12:33 +0100)
committerPeter Stuge <peter@stuge.se>
Tue, 22 May 2012 12:05:19 +0000 (12:05 +0000)
Change-Id: I284824aa6f5eae8f6e910a482e9f7435e649fc0d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/657
Reviewed-by: Peter Stuge <peter@stuge.se>
Tested-by: jenkins
src/target/stm32_stlink.c

index 9afaae0bfc383acabafce477ea5b6cdc085c8f1a..b6d4ffa24e6a7826d68f4334b9b5e111cec4b0f6 100644 (file)
@@ -111,6 +111,8 @@ static int stm32_stlink_load_core_reg_u32(struct target *target,
                 * it was removed from r1 docs, but still works.
                 */
                retval = stlink_if->layout->api->read_reg(stlink_if->fd, 20, value);
+               if (retval != ERROR_OK)
+                       return retval;
 
                switch (num) {
                case ARMV7M_PRIMASK: