MT#55283 protect against possibly signed int

and add an additional comment

Change-Id: I5cb3f434a21879343568f87425356507c2717d7b
pull/2056/head
Richard Fuchs 2 weeks ago
parent ec8f99585d
commit 14561524dc

@ -4240,7 +4240,7 @@ static struct re_timer_thread *launch_thread(unsigned int cpu) {
static int init_play_streams(unsigned int n_play_streams, unsigned int n_stream_packets) {
int ret = 0;
struct re_timer_thread **threads_new = NULL;
unsigned int new_num_threads = 0;
int new_num_threads = 0;
bool need_threads;
struct re_play_stream **new_play_streams, **old_play_streams = NULL;
struct re_play_stream_packets **new_stream_packets, **old_stream_packets = NULL;
@ -4270,7 +4270,7 @@ static int init_play_streams(unsigned int n_play_streams, unsigned int n_stream_
if (need_threads) {
ret = -ENXIO;
new_num_threads = num_online_cpus();
if (new_num_threads == 0)
if (new_num_threads <= 0)
goto err;
threads_new = kzalloc(sizeof(*threads_new) * new_num_threads, GFP_KERNEL);

@ -121,8 +121,8 @@ struct rtpengine_target_info {
size_t len;
} mid_output[RTPE_NUM_OUTPUT_MEDIA];
struct interface_stats_block *iface_stats; // for ingress stats
struct stream_stats *stats; // for ingress stats
struct interface_stats_block *iface_stats; // for ingress stats, pinned memory
struct stream_stats *stats; // for ingress stats, pinned memory
unsigned int extmap:1,
dtls:1,

Loading…
Cancel
Save