summaryrefslogtreecommitdiff
path: root/drivers/crypto/ccp/ccp-ops.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-07-27 14:43:29 +0200
committerTakashi Iwai <tiwai@suse.de>2015-07-27 14:43:29 +0200
commit527c465a3c8716d93201ae34b7fc52679610596d (patch)
treee436b076df094caba9809b9c622374d396e84435 /drivers/crypto/ccp/ccp-ops.c
parentfbce23a0b95763dfc4961ce6240e055c39f497ed (diff)
parent5ce000b297a1c1bb126a14b02acb40318b88a903 (diff)
Merge branch 'for-linus' into for-next
... to make easier developing HDA ext code.
Diffstat (limited to 'drivers/crypto/ccp/ccp-ops.c')
-rw-r--r--drivers/crypto/ccp/ccp-ops.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
index 71f2e3c89424..d09c6c4af4aa 100644
--- a/drivers/crypto/ccp/ccp-ops.c
+++ b/drivers/crypto/ccp/ccp-ops.c
@@ -52,8 +52,7 @@ struct ccp_dm_workarea {
struct ccp_sg_workarea {
struct scatterlist *sg;
- unsigned int nents;
- unsigned int length;
+ int nents;
struct scatterlist *dma_sg;
struct device *dma_dev;
@@ -496,8 +495,10 @@ static int ccp_init_sg_workarea(struct ccp_sg_workarea *wa, struct device *dev,
if (!sg)
return 0;
- wa->nents = sg_nents(sg);
- wa->length = sg->length;
+ wa->nents = sg_nents_for_len(sg, len);
+ if (wa->nents < 0)
+ return wa->nents;
+
wa->bytes_left = len;
wa->sg_used = 0;