if (req->data_processing == SQUASHFS_METADATA) {
/* Extract the length of the metadata block */
- if (req->offset != msblk->devblksize - 1)
- length = *((u16 *)(bh[0]->b_data + req->offset));
- else {
- length = bh[0]->b_data[req->offset];
- length |= bh[1]->b_data[0] << 8;
+ if (req->offset != msblk->devblksize - 1) {
+ length = le16_to_cpup((__le16 *)
+ (bh[0]->b_data + req->offset));
+ } else {
+ length = (unsigned char)bh[0]->b_data[req->offset];
+ length |= (unsigned char)bh[1]->b_data[0] << 8;
}
req->compressed = SQUASHFS_COMPRESSED(length);
req->data_processing = req->compressed ? SQUASHFS_DECOMPRESS