Skip to content
Commit d21fed06 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jonathan Cameron
Browse files

iio: buffer: Move a sanity check at the beginning of 'iio_scan_mask_set()'



This is more standard to have sanity checks at the entry of a function,
instead of allocating some memory first and having to free it if a
condition is not met.

Shuffle code a bit to check 'masklength' before calling 'bitmap_alloc()'

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/98a351adda1908c306e981b9cc86d3dbc79eb5ec.1626261211.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 45851650
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment