History

Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull core fixes from Ingo Molnar: "A handful of objtool updates, plus a documentation addition for __ab_c_size()" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Fix whitelist documentation typo objtool: Fix function fallthrough detection objtool: Don't use ignore flag for fake jumps overflow.h: Add comment documenting __ab_c_size()

Linus Torvalds committed 7 years ago

Commit b2ca74d2 parents 8c05f3b 2decec43 files · +14 −7Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/overflow.h+6−2
@@ -284,11 +284,15 @@ static inline __must_check size_t array3_size(size_t a, size_t b, size_t c) · 283 unmodified lines
284284 return bytes;
285285 }
286286
287−static inline __must_check size_t __ab_c_size(size_t n, size_t size, size_t c)
287+/*
288+ * Compute a*b+c, returning SIZE_MAX on overflow. Internal helper for
289+ * struct_size() below.
290+ */
291+static inline __must_check size_t __ab_c_size(size_t a, size_t b, size_t c)
288292 {
289293 size_t bytes;
290294
291− if (check_mul_overflow(n, size, &bytes))
295+ if (check_mul_overflow(a, b, &bytes))
292296 return SIZE_MAX;
293297 if (check_add_overflow(bytes, c, &bytes))
294298 return SIZE_MAX;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t