diff options
author | Mitchell Levy <[email protected]> | 2023-08-07 23:55:47 +0000 |
---|---|---|
committer | Wei Liu <[email protected]> | 2023-08-11 21:04:42 +0000 |
commit | 4f74fb30ea21d8b2d515f5929d2b46ad6834edba (patch) | |
tree | b05bd25f428cfdb105b91f7d3daeff0dfde0d00a /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4 (diff) |
hv_balloon: Update the balloon driver to use the SBRM API
This patch is intended as a proof-of-concept for the new SBRM
machinery[1]. For some brief background, the idea behind SBRM is using
the __cleanup__ attribute to automatically unlock locks (or otherwise
release resources) when they go out of scope, similar to C++ style RAII.
This promises some benefits such as making code simpler (particularly
where you have lots of goto fail; type constructs) as well as reducing
the surface area for certain kinds of bugs.
The changes in this patch should not result in any difference in how the
code actually runs (i.e., it's purely an exercise in this new syntax
sugar). In one instance SBRM was not appropriate, so I left that part
alone, but all other locking/unlocking is handled automatically in this
patch.
[1] https://lore.kernel.org/all/[email protected]/
Suggested-by: Boqun Feng <[email protected]>
Signed-off-by: "Mitchell Levy (Microsoft)" <[email protected]>
Reviewed-by: Boqun Feng <[email protected]>
Signed-off-by: Wei Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions