decomp_strm_init() asserted that the filter configuration was never
NULL. This holds for the legacy filter configurations, which always carry
the decompression direction of their proxy. But an implicit instance
inherited by a proxy without the matching capability will keep its metadata
while having no applicable direction, leaving its configuration NULL when
the instance is finalized.
Drop the assertion and handle a NULL configuration like a direction disabled
with the "none" mode or without any algorithm: the filter is not attached to
the stream and the instance remains as metadata. The decompression behavior
is unchanged, such a filter was already ignored on every stream.
struct decomp_dir *decomp_dir = FLT_CONF(filter);
struct decomp_state *st;
- BUG_ON(!decomp_dir);
-
- if ((decomp_dir->flags & DECOMP_DIR_FL_MODE_NONE) || !decomp_dir->algos)
+ /* An implicit instance inherited by an incompatible proxy has no
+ * applicable direction. Keep its metadata, but do not instantiate it.
+ */
+ if (!decomp_dir || (decomp_dir->flags & DECOMP_DIR_FL_MODE_NONE) || !decomp_dir->algos)
return 0;
st = pool_alloc(pool_head_decomp_state);