26 Apr
2013
26 Apr
'13
6:54 p.m.
if invalid config is passed, then we return error for memory
Signed-off-by: Vinod Koul vinod.koul@intel.com --- compress.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/compress.c b/compress.c index e80e598..ee792c3 100644 --- a/compress.c +++ b/compress.c @@ -218,8 +218,13 @@ struct compress *compress_open(unsigned int card, unsigned int device, struct snd_compr_caps caps; char fn[256];
+ if (!config) { + oops(&bad_compress, -EINVAL, "passed bad config"); + return &bad_compress; + } + compress = calloc(1, sizeof(struct compress)); - if (!compress || !config) { + if (!compress) { oops(&bad_compress, errno, "cannot allocate compress object"); return &bad_compress; }
--
1.7.0.4