Skip to content

Commit

Permalink
staging: lttng: Fix recent modifications to string_from_user operation
Browse files Browse the repository at this point in the history
Include: a fix for a recently introduced change: obviously max_t should
be used instead of min_t here. Also, a likely should apply to the result
of the comparison, not the variable per se.

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Yannick Brosseau authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent f7f9f45 commit 6431674
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/lttng/probes/lttng-events.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = {
#undef __string_from_user
#define __string_from_user(_item, _src) \
__event_len += __dynamic_len[__dynamic_len_idx++] = \
min_t(size_t, strlen_user(_src), 1);
max_t(size_t, strlen_user(_src), 1);

#undef TP_PROTO
#define TP_PROTO(args...) args
Expand Down Expand Up @@ -557,7 +557,7 @@ __assign_##dest##_2: \
(void) __typemap.dest; \
lib_ring_buffer_align_ctx(&__ctx, ltt_alignof(__typemap.dest));\
__ustrlen = __get_dynamic_array_len(dest); \
if (likely(__ustrlen) > 1) { \
if (likely(__ustrlen > 1)) { \
__chan->ops->event_write_from_user(&__ctx, src, \
__ustrlen - 1); \
} \
Expand Down

0 comments on commit 6431674

Please sign in to comment.