mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 06:33:03 +00:00
sio: Fix error paths
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
6a61c001d2
commit
8ca5d671ad
1 changed files with 6 additions and 0 deletions
|
@ -65,6 +65,9 @@ static void *add_fwdata(size_t size, u32 param_id)
|
|||
u64 iova;
|
||||
void *p = alloc_mapped_data(size, &iova);
|
||||
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
struct sio_fwparam *param = &sio_fwparams[sio_num_fwparams];
|
||||
param->key = param_id;
|
||||
param->value = iova >> 12;
|
||||
|
@ -201,6 +204,9 @@ int sio_setup_fwdata(void)
|
|||
|
||||
int nkeys = find_key_index(rule->keys, 0);
|
||||
u8 *sio_blob = add_fwdata(nkeys * rule->blobsize, rule->fw_param);
|
||||
if (!sio_blob)
|
||||
goto err_nomem;
|
||||
|
||||
if (len % (rule->blobsize + 4) != 0) {
|
||||
printf("%s: bad length %d of ADT property '%s', expected multiple of %d + 4\n",
|
||||
__func__, len, rule->prop, rule->blobsize);
|
||||
|
|
Loading…
Reference in a new issue